Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
04/30/2011 10:41:47 AM (15 years ago)
Author:
djpaul
Message:

Deprecate bp_core_add_admin_menu_page() in favour of add_menu_page(). Fixes #3184

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-core/admin/bp-core-update.php

    r4293 r4309  
    11391139}
    11401140
    1141 /**
    1142  * A better version of add_admin_menu_page() that allows positioning of menus.
    1143  *
    1144  * @package BuddyPress Core
    1145  */
    1146 function bp_core_update_add_admin_menu_page( $args = '' ) {
    1147         global $menu, $admin_page_hooks, $_registered_pages;
    1148 
    1149         $defaults = array(
    1150                 'page_title' => '',
    1151                 'menu_title' => '',
    1152                 'capability' => 'manage_options',
    1153                 'menu_slug'  => '',
    1154                 'function'   => false,
    1155                 'icon_url'   => false,
    1156                 'position'   => 100
    1157         );
    1158 
    1159         $r = wp_parse_args( $args, $defaults );
    1160         extract( $r, EXTR_SKIP );
    1161 
    1162         if ( is_multisite() )
    1163                 add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
    1164         else
    1165                 add_menu_page( $page_title, $menu_title, $capability, $menu_slug, $function, $icon_url, $position );
    1166 }
    1167 
    11681141function bp_core_wizard_message() {
    11691142        if ( isset( $_GET['updated'] ) )
    … …  
    12271200
    12281201        // Add the administration tab under the "Site Admin" tab for site administrators
    1229         bp_core_update_add_admin_menu_page( array(
    1230                 'menu_title' => __( 'BuddyPress', 'buddypress' ),
    1231                 'page_title' => __( 'BuddyPress', 'buddypress' ),
    1232                 'capability' => 'manage_options',
    1233                 'menu_slug'  => 'bp-wizard',
    1234                 'function'   => '',
    1235                 'position'   => 3
    1236         ) );
    1237 
     1202        add_menu_page( __( 'BuddyPress', 'buddypress' ), __( 'BuddyPress', 'buddypress' ), 'manage_options', 'bp-wizard', '', '', 3 );
    12381203        $hook = add_submenu_page( 'bp-wizard', $status, $status, 'manage_options', 'bp-wizard', array( $bp_wizard, 'html' ) );
    12391204
Note: See TracChangeset for help on using the changeset viewer.