Make WordPress Core

Opened 20 years ago

Closed 20 years ago

#507 closed defect (bug) (fixed)

Admin functions loaded after plugins

Reported by: noderat's profile noderat Owned by: matt's profile matt
Milestone: Priority: normal
Severity: minor Version:
Component: Administration Keywords:
Focuses: Cc:

Description

The new functions to allow plugins to hook into the menu fail to work as stated because plugins are loaded fairly early on and are processed before admin-functions.php is included.

MooKitty proposed this solution for dealing with it in a plugin, but it should be fixed in Wordpress so that a nasty hack like this isn't required.

Adds the menu item
if ( ! function_exists( 'add_location_menu' ) ) {

function add_location_menu()
{

add_options_page(('Locations'), ('Edit Geo Info'), 5, 'lm.php');

}

} else {

$LM_is_loaded = TRUE;

}
add_action('admin_menu', 'add_location_menu');

if ( $LM_is_loaded ) :
?>
<div class="wrap">
<h2>Location Manager</h2>

</div>
<?php endif;
?>

Change History (3)

#2 @ryan
20 years ago

That's why we have is_plugin_page(), which is in functions.php. We will not load admin-functions.php before loading the plugins because plugins are loaded not just for the admin backend, but for the frontend of the weblog as well. Tagging admin-functions.php along will clutter the critical path.

#3 @matt
20 years ago

  • fixed_in_version set to 1.5
  • Owner changed from anonymous to matt
  • Resolution changed from 10 to 20
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.