Skip to:
Content

BuddyPress.org

Ticket #5374: 5374.submenu.diff

File 5374.submenu.diff, 4.4 KB (added by imath, 10 years ago)
  • bp-members/admin/bp-members-classes.php

    diff --git bp-members/admin/bp-members-classes.php bp-members/admin/bp-members-classes.php
    index 535828d..78bb1f2 100644
    class BP_Members_List_Table extends WP_Users_List_Table { 
    9999
    100100                // Remove the 'current' class from the 'All' link
    101101                $views['all']        = str_replace( 'class="current"', '', $views['all'] );
    102                 $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '"  class="current">' . sprintf( _nx( 'Pending account <span class="count">(%s)</span>', 'Pending accounts <span class="count">(%s)</span>', $this->signup_counts, 'signup users', 'buddypress' ), number_format_i18n( $this->signup_counts ) ) . '</a>';
     102                $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '"  class="current">' . sprintf( _x( 'Pending <span class="count">(%s)</span>', 'signup users', 'buddypress' ), number_format_i18n( $this->signup_counts ) ) . '</a>';
    103103
    104104                return $views;
    105105        }
    class BP_Members_MS_List_Table extends WP_MS_Users_List_Table { 
    414414                $views['all'] = str_replace( 'class="current"', '', $views['all'] );
    415415                        $class = ' class="current"';
    416416
    417                 $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '"  class="current">' . sprintf( _nx( 'Pending account <span class="count">(%s)</span>', 'Pending accounts <span class="count">(%s)</span>', $this->signup_counts, 'signup users', 'buddypress' ), number_format_i18n( $this->signup_counts ) ) . '</a>';
     417                $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '"  class="current">' . sprintf( _x( 'Pending <span class="count">(%s)</span>', 'signup users', 'buddypress' ), number_format_i18n( $this->signup_counts ) ) . '</a>';
    418418
    419419                return $views;
    420420        }
  • bp-members/bp-members-admin.php

    diff --git bp-members/bp-members-admin.php bp-members/bp-members-admin.php
    index 93d9db9..9712b15 100644
    class BP_Members_Admin { 
    202202                $this->screen_id = array( $edit_page, $this->user_page );
    203203
    204204                foreach ( $hooks as $key => $hook ) {
    205                         add_action( "admin_head-$hook", array( $this, 'modify_admin_menu_highlight' ) );
    206205                        add_action( "load-$hook",       array( $this, $key . '_admin_load' ) );
    207206                }
    208207
     208                add_action( "admin_head-$this->user_page", array( $this, 'modify_admin_menu_highlight' ) );
     209
    209210        }
    210211
    211212        /**
    212          * Highlight the Users menu if on Edit Profile or Signups pages.
     213         * Highlight the Users menu if on Edit Profile.
    213214         *
    214215         * @access public
    215216         * @since BuddyPress (2.0.0)
    class BP_Members_Admin { 
    218219                global $plugin_page, $submenu_file;
    219220
    220221                // Only Show the All users menu
    221                 if ( in_array( $plugin_page, array( 'bp-profile-edit', 'bp-signups' ) ) ) {
     222                if ( $plugin_page = 'bp-profile-edit' ) {
    222223                        $submenu_file = 'users.php';
    223224                }
    224225        }
    225226
    226227        /**
    227          * Remove the Edit Profile & Signups submenu page.
     228         * Remove the Edit Profile page.
    228229         *
    229230         * We add these pages in order to integrate with WP's Users panel, but
    230          * we want them to show up as Views of the WP panel, not as separate
     231         * we want them to show up as a row action of the WP panel, not as separate
    231232         * subnav items under the Users menu.
    232233         *
    233234         * @access public
    class BP_Members_Admin { 
    236237        public function admin_head() {
    237238                // Remove submenu to force using Profile Navigation
    238239                remove_submenu_page( 'users.php', 'bp-profile-edit' );
    239 
    240                 // Remove submenu to force using users views
    241                 remove_submenu_page( 'users.php', 'bp-signups' );
    242240        }
    243241
    244242        /** Community Profile ************************************************/
    class BP_Members_Admin { 
    807805                        $class = ' class="current"';
    808806                }
    809807
    810                 $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '"' . $class . '>' . sprintf( _nx( 'Pending <span class="count">(%s)</span>', 'Pending <span class="count">(%s)</span>', $signups, 'signup users', 'buddypress' ), number_format_i18n( $signups ) ) . '</a>';
     808                $views['registered'] = '<a href="' . add_query_arg( 'page', 'bp-signups', bp_get_admin_url( 'users.php' ) ) . '"' . $class . '>' . sprintf( _x( 'Pending <span class="count">(%s)</span>', 'signup users', 'buddypress' ), number_format_i18n( $signups ) ) . '</a>';
    811809
    812810                return $views;
    813811        }