WPDK
1.5.0
WordPress Development Kit
|
Here you can find a set of examples and how-tos about WPDK in action into a WordPress environment.
Any example and/or how-to is available to anyone through GitHub interface. If you want to download and use these examples in your environment, you naturally have to install WPDK first: please follow these rules to do that.
This how-to creates a simple WordPress plugin and generates, through WPDK object WPDKMenu
, an Hello World!
menu item in the administration area of your WordPress environment. This code is very simple, and shows a basic, not invasive way of using WPDK in developing a WordPress plugin.
Please follow these instructions to see this how-to in action in your WordPress environment.
wpdk-sample-menu-1-master
wpdk-sample-menu-1-master
folder in the wp-content/plugins
directory of your WordPress environment.Hello World!
menu item will appear in the main navigation menu at the left side of the screen.This how-to creates a simple WordPress plugin and generates, through WPDK object WPDKMenu
, an Hello World!
menu item in the administration area of your WordPress environment. This code is relatively more complex than first Hello World! example: the plugin menu is made of two submenu items, each one with its own function called whenever the item is clicked; and the main menu item has an attached icon, as other main menu item in WordPress menu of Administration Screen.
The plugin menu is built through another WPDK way of creating menu in Administration Screen: as an array, with specific array items, processed by renderByArray
static method of WPDKMenu
class. It is another powerful, readable and easy way to accomplish this task with WPDK.
Please follow these instructions to see this how-to in action in your WordPress environment.
wpdk-sample-menu-2-master
wpdk-sample-menu-2-master
folder in the wp-content/plugins
directory of your WordPress environment.Hello World!
menu item will appear in the main navigation menu at the left side of the screen, with an icon at the left, and two related submenu items.This how-to is the first basic sample of a WordPress plugin developed using WPDK: a little more complex sample than #1 and #2 above.
This is the structure:
addSubMenu
and render
of WPDKMenu
class.WPDKViewController
class instance. These specialized instances handle the HTML output shown in the work area of WordPress Administration Screen, and their source code is in plugin_root_dir/classes/wpdk-sample-vc.php
file.display
of any specialized WPDKViewController
class instance, in order to show my own content whenever the related submenu item is clicked.Please follow these instructions to see this how-to in action in your WordPress environment.
wpdk-sample-plugin-1-master
wpdk-sample-plugin-1-master
folder in the wp-content/plugins
directory of your WordPress environment.WPDK Plug#1
menu item will appear in the main navigation menu at the left side of the screen, with an icon at the left, and two related submenu items. Click them to see result.This how-to is the second sample of a WordPress plugin developed using WPDK. This is the structure:
addSubMenu
and render
of WPDKMenu
class.WPDKViewController
class instance. This specialized instance embeds a specific WPDKView
class that shows all the available WPDK graphic controls you can easily use in your own code. Following this simple use case, you can easily build and customize the views that control all aspects and parameters of your WordPress creation. This sample doesn't store user choices in a custom configuration: it is only a container of all available WPDK graphic controls. Next how-to will show you how to save and reload your own preferences using the same internal architecture.Please follow these instructions to see this how-to in action in your WordPress environment.
wpdk-sample-plugin-2-master
wpdk-sample-plugin-2-master
folder in the wp-content/plugins
directory of your WordPress environment.WPDK Plug#2
menu item will appear in the main navigation menu at the left side of the screen, with an icon at the left, and two related submenu items. Click them to see result.This how-to is the third sample of a WordPress plugin developed using WPDK. This is the structure:
addSubMenu
and render
of WPDKMenu
class.WPDKViewController
class instance. This specialized instance embeds a specific WPDKConfigurationView
class called ControlsConfigurationView
, that shows a little subset of WPDK graphic controls driving plugin configuration. You can set values and store them into DB, clicking the Update button; or you can restore values to their default, clicking the Reset to default button. Following this simple use case, you can easily build and customize your own plugin configuration, creating a property into ControlsSettings
model, and setting its value with a specific WPDK graphic control defined into the ControlsConfigurationView
specialized view.updatePostData
method of ControlsConfigurationView
class processes the Update request incoming from related button in the view.resetToDefault
method of ControlsConfigurationView
class processes the Reset to default request incoming from related button in the view.Please follow these instructions to see this how-to in action in your WordPress environment.
wpdk-sample-plugin-3-master
wpdk-sample-plugin-3-master
folder in the wp-content/plugins
directory of your WordPress environment.WPDK Plug#3
menu item will appear in the main navigation menu at the left side of the screen, with an icon at the left, and two related submenu items. Click them to see result.