Topic: Object-Oriented Programming
Blurbette Plugin: An Object-Oriented Project
In this series I’ll take a comprehensive look at creating a plugin from scratch. The concept is to create a custom post type called a Blurbette, which can be inserted into any posts, pages or widgets, and to offer a number of management utilities to create and control. You can download the source using the ...
Blurbette Plugin: Copy Metabox
In this chapter, I’ll create the metabox enabling a user to copy any post to a new Blurbette. This action shouldn’t force the user to leave the edit panel, so copying ought to take place via AJAX. And, for good measure, why not track whether a post has already been copied to a Blurbette, and link to it?
My plan is ...
Blurbette Plugin: Admin Control Panel
In this chapter I’ll proceed a bit differently: I’ll make a few changes to WPCX_Blurbette_Def and WPCX_Blurbette_Registry first, then define the new class below.
The sole aim of this admin control panel is to update a list of options. WordPress provides a Settings API that provides output helpers and manages groups of individual settings; but for no ...
Blurbette Plugin: TinyMCE Control
This time I’ll define a TinyMCE Control class that must be instantiated.
The last one, the Shortcode class, works fine without instantiating because all its properties are one-offs, and its public elements are available to all scopes (global and function).
This class defines a ‘thing’ that has unique properties, and there might be more than one of these ‘things,’ so it must ...
Blurbette Plugin: Organization and First Classes
Almost ready to start building. I’ll first decide how the files within the plugin directory are going to be organized.
WordPress requires at least one ‘main’ PHP file within a plugin directory, which begins with a standardized header. This header is essentially a copy-and-pastable ‘form’ you can replace with descriptive information; mine looks like this:
View the WordPress ...
Blurbette Plugin: The Blueprint
In this chapter I’ll walk through an initial analysis and design phase. I’ll start with the rough concept, and end up with a wireframe we can use to build our classes in remaining chapters.
The rough concept: create a plugin that provides “Blurbettes,” which are small content clippings that can be included anywhere in a blog. Change a Blurbette, and the ...