Created
September 10, 2013 07:33
-
-
Save maniaks/6506115 to your computer and use it in GitHub Desktop.
WordPress: Add Settings page to custom post type
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 | |
//Example from Codex page : http://codex.wordpress.org/Function_Reference/add_submenu_page | |
//Add this in your functions.php file, or use it in your plugin | |
add_action('admin_menu', 'register_my_custom_submenu_page'); | |
function register_my_custom_submenu_page() { | |
add_submenu_page( 'edit.php?post_type=book', 'My Custom Submenu Page', 'My Custom Submenu Page', 'manage_options', 'my-custom-submenu-page', 'my_custom_submenu_page_callback' ); | |
} | |
function my_custom_submenu_page_callback() { | |
echo '<div class="wrap"><div id="icon-tools" class="icon32"></div>'; | |
echo '<h2>My Custom Submenu Page</h2>'; | |
echo '</div>'; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thank you!