Wordpress Plugin pageWorldpress Plugin Page
The text to be shown in the page's caption tag when the page's menus are checked Default: The text to be used for the default menu: No $ability (string) (required) The ability that is needed for this item to be visible to the end users.
Standard: Name of the slot under which this submenu is referenced (should be unambiguous for this submenu). Standard: n/a $function (Callback) (optional) The call back button to display the contents of this page. Standard:'' This feature is a basic wrapper for a call to add_submenu_page() that passes the receive line and specifies'plugins.php' as the $parent_slug line.
That means that the new page will be added as a submenu to the plugin list. It uses the $capability argument to specify whether or not to include the page in the menus depending on the roles and abilities of the currently active onlooker. This feature, which handles the option page display, should also check the user's abilities.
It is typically used in a feature listed with a check mark'admin_menu' (see Adding Administration Menus): add_action('admin_menu','my_plugin_menu'); add_plugins_page('My Plugin Page','My Plugin','read','my-unique-identifier','my_plugin_function'); add_plugins_page() is found in wp-admin/includes/plugin.php.
Create a Wordpress Plugin Part 1: Add the admin page
WorldPress is one of the most beloved CMS on the web. Actually, we use WordPress for both our blogs and our websites. I' ll show you in this tutorial how to build a WordPress plugin that generates a menue point and a corresponding page in the Administrative Panel. I recently spent some with PHP and WordPress to build a plugin that uses our PDF to HTML5 webservice to translate our contents and then view them on a page (more on that later).
Let's immerse ourselves with a plugin that shows "Hello World!" on all pages. Headerkommentar here is what Wordpress uses to recognize that it is a plugin, it is only needed for the plugin start point (other phone calls are invoked with include/require_once).
As an absolute must you have "Plugin Name" in the headline, so that it is enumerated in the Plugin-Unterverzeichnis. In order to store the files, make sure that they are in the subfolder of your Wordpress install "wp-content/plugins", I suggest to put them there in a subfolder so that you can organize your plugin.
In order to enable the plugin, go to the Wordpress administration area and select the plugin item. Locate the new plugin and enable it. Each page of the website now has "Hello world!" at the top of the top right corner. It' not very handy, but it gives an idea of how WordPress plug-ins work.
The WordPress handling of plug-ins is as easy as possible to plug in. If a plugin is enabled, WordPress executes the plugin's primary alphp-files. That means that we have to block when our plugin will be on. Knowing how to recognize a WordPress plugin, we can proceed with the creation of a real plugin that does something useful.
One good place to start would be a side bar option that allows us to have a page in the management panel. It is useful so that the administrator of a Wordpress site can set up your plugin. In order to do this, we have to latch into the operation in which the administration panel is located.
If WordPress downloads a page, it goes through a series of operations that we can start with the add_action feature. The following example shows how to add a link to the Admin-Panel, which leads us to a page called "Hello Word! "Let's take a look at the functions: add_action('admin_menu','test_plugin_setup_menu'); here we get to the point where the menubar on the admin board begins to load and tell Wordpress that we want to run the'test_plugin_setup_menu' command a few rows below.
button add_menu_page('Test Plugin Page','Test Plugin','manage_options','testplugin','test_init'); here we insert the menue page and the menueit. Test Plugin Page' is the header of our page. And the second paramter'Test Plugin' is the tag for our administration panels. Thirdly, it defines which user can see the feature by restricting certain user accounts with certain functions.
We have now set up our option page and we have a stage floor to start playing with some more WordPress functions. The next I will show you how to use a web service with your plugin. If you want to know more about how to create WordPress plug-ins, I suggest you check the codex, which is very well known.