Created
May 27, 2014 09:52
-
-
Save imvision/5ceb22c9183f7b17da8d to your computer and use it in GitHub Desktop.
Wordpess cheat sheet
This file contains hidden or 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 | |
/** | |
* Plugins | |
* / | |
### Create a hidden plugin page | |
# Add a sub menu page | |
function jobman_admin_setup() { | |
add_submenu_page( 'jobman-conf', __( 'Project Manager', 'jobman' ), __( 'Tickets', 'jobman' ), 'publish_posts', 'pm_project_tickets', 'pm_project_tickets' ); | |
} | |
add_action( 'admin_menu', 'jobman_admin_setup' ); | |
# Hide it from menu so that it is still accessible | |
add_action( 'admin_head', 'adjust_the_wp_menu', 999 ); | |
function adjust_the_wp_menu() { | |
remove_submenu_page('jobman-conf', 'pm_project_tickets'); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment