Saturday , 29 April 2017
WordPress Widgets API

Widgets API – WordPress Plugin Tutorial

The widgets API is what we’ll be learning next. It’s very simple to use. It does involve having basic knowledge of PHP OOP. If you don’t know how to create classes, then I recommend you learn the fundamentals of OOP and then come back here. Getting Started Create a new plugin called wpWidgetEx. In our index.php file, lets use this …

Read More »
WordPress Settings API

WordPress Settings API Part 3 – WordPress Plugin Tutorial

In our last tutorial, we created a functional WordPress plugin using the WordPress settings API. A cool feature that WordPress allows us to do is do some validating of our own. You may have an input field where you’ll only accept non numeric characters. You may want to strip out a certain word. WordPress does some validating, but you may …

Read More »
WordPress Settings API

WordPress Settings API Part 2 – WordPress Plugin Tutorial

In our previous tutorial, I explained what the settings API is and how useful it is. I also  gave some code to help us get started. In this part, we’ll be discussing how to use the WordPress Settings API with the same plugin we crated in our last tutorial. We’ll mainly be working in our display-admin.inc.php file for this tutorial. …

Read More »
WordPress Settings API

WordPress Settings API Part 1 – WordPress Plugin Tutorial

WordPress offers many APIs for us to use. In our previous tutorials, we talked about how to create forms in the WordPress admin with HTML. While it was relatively simple, it’s time consuming to set up our form, validate the info, update and set values. Luckily, WordPress introduced the WordPress settings API in version 2.7. Why use the WordPress Settings …

Read More »
WordPress Admin Forms

WordPress Admin Forms – WordPress Plugin Tutorial

This will be our most complex plugin yet. We’ll be doing a couple of things we’ve done before and so some things will be skipped. In this tutorial, we’ll learn how to create WordPress admin forms. This will allow users to change the data for your options. Before, we’ve been updating the information in the code. This isn’t user friendly. …

Read More »
Uninstalling a Plugin

Uninstalling A Plugin – WordPress Plugin Tutorial

We’ve created a lot of plugins so far. Some are harmless and others take up space in our WordPress installation. Today, we’ll learn about uninstalling a plugin. We’ll be working with the same plugin we created in the last tutorial. By creating an option, we’ve also created a column in the database. If a user uninstalls your plugin, then that …

Read More »
WordPress Options API

WordPress Options API – Part 2 – WordPress Plugin Tutorial

This is part 2 of our WordPress Options API tutorial. We’ll be discussing how to make our plugin more efficient using arrays in a single option setting instead of creating multiple options for 1 plugin. We’ll be using the same code we used in our last tutorial. Let’s update our file to this. [crayon-590520f119710293424795/]  WordPress Options API A couple of …

Read More »
WordPress Options API

WordPress Options API – Part 1 – WordPress Plugin Tutorial

We learned how to create menus. Now, we’ll learn how to use the WordPress options API to allow us to store user settings for our plugin. The options API is a great way to store settings for your plugin. Your users won’t have to define every single option every time they have to use your plugin. They could also customize …

Read More »
WordPress Admin Submenus

WordPress Admin Submenus – WordPress Plugin Tutorial

In our last lesson, we discussed how to create top-level menus. We’ll now learn how to create WordPress admin submenus. We’ll be working with the same plugin we created in our previous lesson. Let’s update our menus.inc.php file to this. [crayon-590520f11a47c562816902/] WordPress Admin Submenus As you can see we used the add_submenu_page() function to add a submenu. It takes in …

Read More »
WordPress Admin Menus

WordPress Admin Menus – WordPress Plugin Tutorial

So far, our plugins have been very simple. To extend the functionality of our WordPress plugins, it’s best to have a set of options for a user to configure in their admin panel. Before we can get there, we first need to add a way to get there. We can easily do this by creating WordPress admin menus for our …

Read More »
Enclosing Shortcodes

Enclosing Shortcodes – WordPress Plugin Tutorial

In our previous tutorial, we learned about attributes. Our last shortcode took in 2 attributes, which were the link and the text, but it isn’t exactly the best idea to use the text attribute because what if the user is submitted paragraphs of text? Or even worse, what if they’re using quotes their message? Our solution, enclosing shortcodes. WordPress allows …

Read More »
Shortcode Attributes

Shortcode Attributes – WordPress Plugin Tutorial

Let’s take it up a step and make our shortcode more flexible. What if we want the user to define their own link? Well, it’s possible if we create shortcode attributes. Let’s learn how to do so. We’ll be using the same plugin we made in the previous tutorial. We’ll just be adding onto it. Update the post you created …

Read More »
Creating WordPress Shortcodes

Creating WordPress Shortcodes – WordPress Plugin Tutorial

Shortcodes are very popular in WordPress plugins. Today, we’ll be creating WordPress shortcodes. It’s relatively simple. Create a new plugin called wpshortcodeex and update the index.php to look like this. [crayon-590520f11d53e080638760/] You’ll notice I renamed the function for checking the WordPress version. Reason is we don’t want this plugin to collide with any other functions. So, we give it a …

Read More »
WordPress Coding Standard

WordPress Coding Standard – WordPress Plugin Tutorial

This is something that should’ve been covered in the 2nd tutorial. We’ll be discussing what the WordPress coding standard is. I’m actually not going to write everything down, because everything is already written and explained on WordPress’s Codex. All information is clear and easy to understand. http://codex.wordpress.org/WordPress_Coding_Standards If you don’t feel like reading, watch the video to get a good understand …

Read More »
Deactivating a Plugin

Deactivating A Plugin – WordPress Plugin Tutorial

We’ve been learning a lot so far, but our plugins would be useless if the user didn’t have the correct WordPress version. In this lesson, we’re gonna take a look at how to grab the user’s current WordPress version and how we should go about deactivating a plugin. This function is actually so useful, we’re not going to create a …

Read More »