Anatomy Of A WordPress Plugin: Adding Admin Submenus For Options Pages

I have not yet written a plugin for WordPress that is complex enough to require the settings to be broken down over multiple pages in the Admin area, but this is something that is possible to do fairly easily. In the last post we covered adding a link on the… Read more“Anatomy Of A WordPress Plugin: Adding Admin Submenus For Options Pages”

Anatomy Of A WordPress Plugin: Adding Admin Menu For Options Page

All but the most simple of WordPress plugins will require an options page in the Admin area which will need to be made accessible to the admin users. The main way this would be done is to add an entry to the admin menu. This is done using the add_action… Read more“Anatomy Of A WordPress Plugin: Adding Admin Menu For Options Page”

Anatomy Of A WordPress Plugin: Shortcode Extract Of Parameters

In my last post I discussed adding a shortcode to the plugin and covered how to extract the parameters passed into the function from the shortcode. There is one variation to this example which it is probably worth mentioning. In the last post I showed that the width parameter could… Read more“Anatomy Of A WordPress Plugin: Shortcode Extract Of Parameters”

Anatomy Of A WordPress Plugin: Adding A Shortcode

Additional functionality can be added to posts and pages through the use of shortcodes. Up to now I have created and published six plugins of which two thirds use a shortcode to add easy-to-use additional functionality. For example the Series Index plugin uses a [series-index] shortcode to display the series… Read more“Anatomy Of A WordPress Plugin: Adding A Shortcode”

Anatomy Of A WordPress Plugin: Loading CSS & JavaScript Together

In the last couple of posts in this series I’ve taken a look at using wp_enqueue_scripts to load the CSS and JavaScript files. In those examples, the CSS and JavaScript were loaded via different functions. However, we could use add_action to call one function to load both the CSS and… Read more“Anatomy Of A WordPress Plugin: Loading CSS & JavaScript Together”

Anatomy Of A WordPress Plugin: Loading The JavaScript

Additional functionality can be added to a WordPress using JavaScript. For example, the Series Index uses JavaScript to allow the index to be shown or hidden when the user clicks a toggle link. The JavaScript will be stored in a separate file which, when I use it, I usually call… Read more“Anatomy Of A WordPress Plugin: Loading The JavaScript”

Anatomy Of A WordPress Plugin: Loading The CSS

The majority of the plugins I have created have created have an output visible to the user. For example, the Posts Archive can be used in a widget (see the side menu) or on a page. And to display the output to the best advantage it needs to be formatted;… Read more“Anatomy Of A WordPress Plugin: Loading The CSS”

Anatomy Of A WordPress Plugin: Coding Paradigms

Having covered the basics of a WordPress plugin from the php tags to the file header, I thought a quick discussion of the code types in which WordPress plugins can be written and which I have used. There are two code types that can be used: Procedural Programming Object Oriented… Read more“Anatomy Of A WordPress Plugin: Coding Paradigms”