WordPress.org

Support

Support » Plugins and Hacks » [Resolved] Admin_menu function not working

[Resolved] Admin_menu function not working

  • So I’m trying to develop a custom plugin for a site that I’m working on, and I’m having an unexpectedly difficult time with it. Right now, I can’t seem to get a top-level menu to show up using the admin_menu function. I’ve been going around and around, and I can’t seem to figure out why. Does anyone have any clue what I’m doing wrong?

    Here’s my code so far, with some details changed:

    (also some database stuff above, but that seems to be in working order)
    
    function myprefix_add_new() { ?>
    	<div class="wrap">
              <h2>My Title Goes Here</h2>
            </div>
        </div>
    <?php }
    
    function myprefix_admin_menu_add() {
    	$mymainpage = add_menu_page("My Page Title","My Page Title",1,__FILE__,'myprefix_add_new');
    }
    
    add_action('admin-menu','myprefix_admin_menu_add');
    
    ?>

    Does anyone see what I could be doing wrong? Or have done wrong?

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘[Resolved] Admin_menu function not working’ is closed to new replies.