![]() ![]() We’ll need to add the settings page to our admin panel so we can manage our API credentials easily. You will likely edit this file with the version number and the short description of your plugin. sendex.php: This is the main plugin bootstrap file.uninstall.php: This script is called when the user clicks on the Delete link in the WordPress plugin backend.README.txt: This will include your plugin name, compatibility version, and description as seen on the plugin page in the WordPress repository.The public folder is the similar files as our admin folder except that all codes here are for public facing functionalities. pot file to make your plugin in multiple languages. The loader file class-sendex-loader.php which will basically call all our actions in the main class file The internationalization file class-sendex-i18n.php ![]() The deactivator file class-sendex-desactivator.php The activator file class-sendex-activator.php The main plugin PHP class class-sendex.php where we will add all our actions and filters This folder contains all our admin facing code including css, js, partials folders and a php file class-sendex-admin.php. When you open the plugin folder sendex, you will notice that the plugin has 4 folders: admin, includes, languages, public and some other files. Now that our plugin is installed, let’s review our boilerplate folder structure. Activate the plugin by clicking on the activate link. If you are logged in, you should see our new plugin in the list of plugins. Once you’re done, go to the admin plugin page localhost/sendex/wp-admin. You can change the details later once you fully understand the code.Īfter downloading the boilerplate above, extract it into your WordPress plugin folder i.e. This will make it easier to follow along with the code. I’d suggest you use the same details I entered. You can fill in whatever you want in the fields above. Plugin Name = SEND SMS Plugin Slug = sendex Plugin Uri = Author Name = Onwuka Gideon Author Email = Author Url = For example, here are the fields I filled in: To get started, just go to the WordPress Plugin Boilerplate Generator and fill-out the form then click on the Build button. This boilerplate will get you started quickly with a standardized, organized and object-oriented foundation – basically, everything you want if you started from scratch. You might be asking why are we using a boilerplate instead of building from scratch. The best way to begin with a new plugin is by working on the incredibly useful WordPress Plugin Boilerplate. Implement the sending messages functionality.Here’s a rundown of what we’ll do with WordPress: After that, navigate to the Twilio Console and note down your account sid and auth token keys. Head to Twilio to create an account if you don’t have one already. If the login was successful, you’re ready to go. The admin dashboard should be localhost/sendex/wp-admin assuming you used the same installation path that I used.Īssuming your installation path is, you can get the admin dashboard by opening in your browser. This is where we will be working from now on. ![]() Once you are done with the installation, log into your WordPress admin dashboard. I’ll be using it as my reference all throughout this tutorial. I have my WordPress installation path as localhost/sendex/. You can download and install one locally by following the installation instructions here. Since we are adding an entirely new function to WordPress, we have to use a plugin to achieve this.įirst, we need to install WordPress if you haven’t already. Plugins let you extend and add functionality to your WordPress site. Let’s build a WordPress plugin in PHP so you can send text messages to readers about topics they care about. Sending bulk SMS is a great tool to have in your toolbelt. Writers want to stay in touch with their readers. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |