Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
03/29/2014 12:13:41 AM (10 years ago)
Author:
imath
Message:

Add a link to Registration settings in Sign-ups Administration screen

In case registration is disabled and no pending sign-ups were found display a link to the blog or network settings.

props imath, boonebgorges

See #5374

File:
1 edited

Legend:

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

    r8136 r8198  
    160160     */
    161161    public function no_items() {
    162         _e( 'No pending accounts found.', 'buddypress' );
     162
     163        if ( bp_get_signup_allowed() ) {
     164            esc_html_e( 'No pending accounts found.', 'buddypress' );
     165        } else {
     166            $link = false;
     167
     168            // Specific case when BuddyPress is not network activated
     169            if ( is_multisite() && current_user_can( 'manage_network_users') ) {
     170                $link = '<a href="' . esc_url( network_admin_url( 'settings.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>';
     171            } elseif ( current_user_can( 'manage_options' ) ) {
     172                $link = '<a href="' . esc_url( bp_get_admin_url( 'options-general.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>';
     173            }
     174           
     175            printf( __( 'Registration is disabled. %s', 'buddypress' ), $link );
     176        }
     177           
    163178    }
    164179
     
    463478     */
    464479    public function no_items() {
    465         _e( 'No pending accounts found.', 'buddypress' );
     480        if ( bp_get_signup_allowed() ) {
     481            esc_html_e( 'No pending accounts found.', 'buddypress' );
     482        } else {
     483            $link = false;
     484
     485            if ( current_user_can( 'manage_network_users' ) ) {
     486                $link = '<a href="' . esc_url( network_admin_url( 'settings.php' ) ) . '">' . esc_html__( 'Edit settings', 'buddypress' ) . '</a>';
     487            }
     488
     489            printf( __( 'Registration is disabled. %s', 'buddypress' ), $link );
     490        }
    466491    }
    467492
Note: See TracChangeset for help on using the changeset viewer.