mirror of
https://github.com/inretio/WordPress-Plugin-Boilerplate
synced 2024-12-22 11:53:53 +02:00
Merge pull request #81 from barryceelen/patch-1
Place options page under 'Settings' in stead of 'Plugins' menu
This commit is contained in:
commit
2053eca643
1 changed files with 8 additions and 2 deletions
|
@ -296,13 +296,19 @@ class Plugin_Name {
|
|||
public function add_plugin_admin_menu() {
|
||||
|
||||
/*
|
||||
* Add a settings page for this plugin to the Settings menu.
|
||||
*
|
||||
* NOTE: Alternative menu locations are available via WordPress administration menu functions.
|
||||
*
|
||||
* Administration Menus: http://codex.wordpress.org/Administration_Menus
|
||||
*
|
||||
* TODO:
|
||||
*
|
||||
* Change 'Page Title' to the title of your plugin admin page
|
||||
* Change 'Menu Text' to the text for menu item for the plugin settings page
|
||||
* Change 'manage_options' to the capability you see fit (http://codex.wordpress.org/Roles_and_Capabilities)
|
||||
*/
|
||||
$this->plugin_screen_hook_suffix = add_plugins_page(
|
||||
$this->plugin_screen_hook_suffix = add_options_page(
|
||||
__( 'Page Title', $this->plugin_slug ),
|
||||
__( 'Menu Text', $this->plugin_slug ),
|
||||
'manage_options',
|
||||
|
@ -330,7 +336,7 @@ class Plugin_Name {
|
|||
|
||||
return array_merge(
|
||||
array(
|
||||
'settings' => '<a href="' . admin_url( 'plugins.php?page=' . $this->plugin_slug ) . '">' . __( 'Settings', $this->plugin_slug ) . '</a>'
|
||||
'settings' => '<a href="' . admin_url( 'options-general.php?page=' . $this->plugin_slug ) . '">' . __( 'Settings', $this->plugin_slug ) . '</a>'
|
||||
),
|
||||
$links
|
||||
);
|
||||
|
|
Loading…
Reference in a new issue