Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: _admin_menu

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
228 $menu[99] = array( '', 'read', 'separator-last', '', 'wp-menu-separator-last' );
229
230 // Back-compat for old top-levels
231 $_wp_real_parent_file['post.php'] = 'edit.php';
232 $_wp_real_parent_file['post-new.php'] = 'edit.php';
233 $_wp_real_parent_file['edit-pages.php'] = 'edit.php?post_type=page';
234 $_wp_real_parent_file['page-new.php'] = 'edit.php?post_type=page';
235 $_wp_real_parent_file['wpmu-admin.php'] = 'ms-admin.php';
236
237 do_action('_admin_menu');
238
239 // Create list of page plugin hook names.
240 foreach ($menu as $menu_page) {
241      if ( false !== $pos = strpos($menu_page[2], '?') ) {
242           // Handle post_type=post|page|foo pages.
243           $hook_name = substr($menu_page[2], 0, $pos);
244           $hook_args = substr($menu_page[2], $pos + 1);
245           wp_parse_str($hook_args, $hook_args);
246           // Set the hook name to be the post type.