adsense

How to Change the Order of the Menu for WordPress Plugins





1. Log into the WordPress dashboard from your website's wp-admin directory. Navigate to 'Plugins' and click the 'Editor' link. Select the plugin you want to edit from the drop-down box.
2. Locate the 'add_menu_page()' function in the code of the plugin. If you do not find this code in the file that automatically loaded when you selected the plugin in the editor, look for it in any other files the plugin uses. The files are listed to the right of the editor.

3. Add the position setting as the last parameter in the 'add_menu_page()' function. This parameter takes integer numbers, such as '5' or '20.' The lower the number, the higher the menu page for your plugin to appear in the dashboard menu. By default, plugin options pages go to the bottom of the menu. Here is an example of an 'add_menu_page()' function with the position parameter added to the end of the parameter list:add_menu_page( 'The Plugin Options', 'My Plugin', 'edit_plugins', 'my-plugin-options', 'mypluginfunction', 20 );In this example, adding '20' to the end of the parameter list puts this plugin options page at the bottom of the menu.
4. Locate the 'add_submenu_page()' functions in your plugin if any sub-menus exist. You cannot give each its own position setting, but the first sub-menu created will appear first in the list. Reorder the functions to reorder the sub-menu pages.

Comments

0 Responses to "How to Change the Order of the Menu for WordPress Plugins"

Post a Comment

Popular Posts

About