WordPress.org

Ready to get started?Download WordPress

Forums

2.7: Migrating Plugin Admin Menus (2 posts)

  1. redwallhp
    Member
    Posted 5 years ago #

    Okay... What changed in WordPress 2.7 in relation to add_submenu_page()?

    I develop the WP125 plugin, which creates a top-level "Ads" menu with three submenus. It worked perfectly in 2.6, 2.5, and 2.4, but in the 2.7 trunk the submenus don't link properly (oddly the top-level one does fine).

    For example, the Add/Edit page is supposed to be this: /wp-admin/admin.php?page=wp125_addedit but in 2.7 trunk the link target is /wp-admin/wp125/wp125.php?page=wp125_addedit.

    The relevant portion of the plugin source is:

    add_menu_page("125x125 Ads", "Ads", MANAGEMENT_PERMISSION, __FILE__, "wp125_write_managemenu");
    add_submenu_page(__FILE__, "Manage 125x125 Ads", "Manage", MANAGEMENT_PERMISSION, __FILE__, "wp125_write_managemenu");
    add_submenu_page(__FILE__, "Add/Edit 125x125 Ads", "Add/Edit", MANAGEMENT_PERMISSION, 'wp125_addedit', "wp125_write_addeditmenu");
    add_submenu_page(__FILE__, "125x125 Ad Settings", "Settings", MANAGEMENT_PERMISSION, 'wp125_settings', "wp125_write_settingsmenu");

    What's going on here? How should I fix this? It needs to work in the upcoming WP 2.7, as well as in previous releases.

  2. redwallhp
    Member
    Posted 5 years ago #

    Trunk is a funny thing all right... It's working again today. Something must've been fixed. :D

Topic Closed

This topic has been closed to new replies.

About this Topic