In the second part of this series, we prepared simple admin facing functionality for our plugin. We provided the users with an options page where they can tweak the plugin according to their preferences.
If you missed part 1 and 2, please find them below:
- The WordPress Plugin Boilerplate Part 1: Speed up Development Using the WordPress Plugin Boilerplate
- The WordPress Plugin Boilerplate Part 2: Developing a WordPress Plugin
For this article, we're going to implement the public facing functionality of the plugin. This means that we're going to retrieve the user preferences, determine whether that specific post is outdated or not, and display the notice accordingly on its single post view. Let’s get started!
Preparing the Theme
We need to prepare our theme so that we can test it out later. We are going to use the Twenty Fifteen theme that is shipped by default with WordPress. Rather than populating the posts manually, we are going to use the theme unit test data provided by the Theme Review team to populate the posts.
We need to download the theme-unit-test-data.xml provided on the above Codex page and import it into our WordPress installation. The WordPress built-in import functionality can be found by navigating to Tools > Import from the sidebar.
We will be presented with various choices, and since we are importing the WordPress export file, we are going to choose WordPress. Depending on the WordPress installation, a plugin popup will be displayed if we do not have the WordPress Importer plugin installed. Just go ahead and install the plugin first if you do not have it and we will proceed with the actual importing process once it is done.
Continue reading %The WordPress Plugin Boilerplate Part 3: The Last Steps%
by Firdaus Zahari via SitePoint
No comments:
Post a Comment