Make WordPress Core

Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#10708 closed defect (bug) (invalid)

Root level plugin admin menus not showing in Wordpress 2.8.4

Reported by: tinwatchman Owned by: westi
Milestone: Priority: normal
Severity: normal Version: 2.8.4
Component: Plugins Keywords:
Focuses: Cc:


Hello -

I'm trying to develop a plugin on an install of Wordpress 2.8.4. However, I'm being held up by the fact that I can't seem to create root-level admin menus.

To make sure something wasn't going wrong elsewhere in the plugin, I created a new test plugin to isolate the problem. Here's my code:

Plugin Name: Admin Menu Test
Plugin URI: http://www.jonstout.net/
Description: Attempts to create a new root level menu page in Wordpress 2.8.4
Version: 0.1
Author: Jon Stout
Author URI: http://www.jonstout.net/

function menutest_mypage() { ?>
	<div class="wrap">
        <h2>Menu Test</h2>
        <p>Menu test was successful!</p>
<?php }

function menutest_add_admin_menu() {
	$menutestMenuPage = add_menu_page('Menu Test','Menu Test',1,__FILE__,'menutest_mypage');



Starting up the plugin resulted in - no new admin menu. With all other plugins turned off, using the default Wordpress theme; on n Linux-Apache server running PHP 5.2.8. What makes it particularly bizarre is that I have another plugin using the same sort of code on another site / another server using nearly the exact same code without any problems whatsoever. I've tried a complete reinstall, complete with a new database and everything; still no luck.

Does anyone have any idea what's going on? The only thing I can think of at this point is that there might be a bug in the plugin API code in that security update that happened over the weekend. Any ideas?

Thank you for your time.

Change History (4)

#1 @tinwatchman
6 years ago

  • Resolution set to fixed
  • Status changed from new to closed

Dammit. I just saw it. The hook is supposed to be 'admin_menu', not 'admin-menu.' Sorry for bothering everyone.

#2 @strider72
6 years ago

  • Resolution fixed deleted
  • Status changed from closed to reopened

#3 @strider72
6 years ago

  • Resolution set to invalid
  • Status changed from reopened to closed

#4 @Denis-de-Bernardy
6 years ago

  • Milestone Unassigned deleted
Note: See TracTickets for help on using tickets.