Create custom admin panel with add_menu_page

Adding this snippet to the functions.php of your wordpress theme will add a top level menu to your admin menu linking to a custom admin panel.

 

 

add_action('admin_menu', 'create_custom_panel');
function create_custom_panel() {
add_menu_page('Custom panel', 'Custom panel', 'manage_options', 'custom-panel', 'custom_panel');
}
function custom_panel(){
echo '<div class="wrap"><div id="icon-options-general" class="icon32">
<br>
</div>
<h2>Custom panel</h2></div>';
}

Be Sociable, Share!

Leave a comment