-
-
Save tommcfarlin/2003d0b6fcfe5acf9af4dd973cb0eb48 to your computer and use it in GitHub Desktop.
[WordPress] WordPress Menu Page (And A Submenu Page or Two, Too!)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_action( 'plugins_loaded', 'acme_directory_importer' ); | |
/** | |
* Starts the plugin. | |
* | |
* @since 1.0.0 | |
*/ | |
function acme_directory_importer() { | |
if ( ! is_admin() ) { | |
return; | |
} | |
// Start the machine... | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
public function display() { | |
add_menu_page( | |
'Settings', | |
'Settings', | |
'manage_options', | |
'acme-directory', | |
array( $this->settings, 'display' ), | |
'', | |
30 | |
); | |
add_submenu_page( | |
'acme-directory', | |
'Settings', | |
'Settings', | |
'manage_options', | |
'acme-settings', | |
array( $this->settings, 'display' ) | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment