Skip to:
Content

BuddyPress.org

Changeset 8136


Ignore:
Timestamp:
03/15/2014 10:54:27 AM (10 years ago)
Author:
imath
Message:

Display a Manage Signups submenu to Users menu in wp-admin

Signups management is simulating a new view in the wp-admin users page. A Pending link is available after the different WordPress views to filter the users by roles. It appears the Signups screen can be a bit difficult to find for site or network administrators. As a result, it is best to display the Manage Signups submenu instead of removing it.

See #5374

props johnjamesjacoby, boonebgorges

Location:
trunk/bp-members
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/bp-members/admin/bp-members-classes.php

    r8119 r8136  
    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;
     
    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;
  • trunk/bp-members/bp-members-admin.php

    r8122 r8136  
    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
    209     }
    210 
    211     /**
    212      * Highlight the Users menu if on Edit Profile or Signups pages.
     208        add_action( "admin_head-$this->user_page", array( $this, 'modify_admin_menu_highlight' ) );
     209
     210    }
     211
     212    /**
     213     * Highlight the Users menu if on Edit Profile.
    213214     *
    214215     * @access public
     
    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        }
     
    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     *
     
    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
     
    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;
Note: See TracChangeset for help on using the changeset viewer.