Skip to content

Instantly share code, notes, and snippets.

@maniaks
Created September 10, 2013 07:33
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save maniaks/6506115 to your computer and use it in GitHub Desktop.
Save maniaks/6506115 to your computer and use it in GitHub Desktop.
WordPress: Add Settings page to custom post type
<?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>';
}
?>
@nathabonfim59
Copy link

Thank you!

@paulorocktrade
Copy link

Thanks you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment