Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
05/13/2021 08:26:05 AM (5 years ago)
Author:
imath
Message:

BP Settings: remove links to view Register and Activate pages

As these pages can only be reached by logged out users, to avoid to confuse Admins we're replacing the links with a message to inform them they need to log out to view these pages.

Fixes #8475

File:
1 edited

Legend:

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

    r12927 r12948  
    118118    $directory_pages = bp_core_admin_get_directory_pages();
    119119
    120     if ( !empty( $directory_pages ) ) : ?>
    121 
    122         <h3><?php _e( 'Directories', 'buddypress' ); ?></h3>
    123 
    124         <p><?php _e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p>
     120    if ( ! empty( $directory_pages ) ) : ?>
     121
     122        <h3><?php esc_html_e( 'Directories', 'buddypress' ); ?></h3>
     123
     124        <p><?php esc_html_e( 'Associate a WordPress Page with each BuddyPress component directory.', 'buddypress' ); ?></p>
    125125
    126126        <table class="form-table">
     
    142142                                'echo'             => false,
    143143                                'show_option_none' => __( '- None -', 'buddypress' ),
    144                                 'selected'         => !empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
     144                                'selected'         => ! empty( $existing_pages[$name] ) ? $existing_pages[$name] : false
    145145                            ) ); ?>
    146146
     
    148148
    149149                                <a href="<?php echo esc_url( get_permalink( $existing_pages[$name] ) ); ?>" class="button-secondary" target="_bp">
    150                                     <?php _e( 'View', 'buddypress' ); ?> <span class="dashicons dashicons-external" aria-hidden="true"></span>
     150                                    <?php esc_html_e( 'View', 'buddypress' ); ?> <span class="dashicons dashicons-external" aria-hidden="true"></span>
    151151                                    <span class="screen-reader-text"><?php esc_html_e( '(opens in a new tab)', 'buddypress' ); ?></span>
    152152                                </a>
     
    186186    if ( !empty( $static_pages ) ) : ?>
    187187
    188         <h3><?php _e( 'Registration', 'buddypress' ); ?></h3>
     188        <h3><?php esc_html_e( 'Registration', 'buddypress' ); ?></h3>
    189189
    190190        <?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : ?>
    191             <p><?php _e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?></p>
     191            <p>
     192                <?php esc_html_e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?>
     193                <?php esc_html_e( 'These pages will only be reachable by users who are not logged in.', 'buddypress' ); ?>
     194            </p>
    192195        <?php else : ?>
    193196            <?php if ( is_multisite() ) : ?>
    194197                <p>
    195198                    <?php
    196                     /* translators: %s: the link to the Network settings page */
    197                     printf( __( 'Registration is currently disabled.  Before associating a page is allowed, please enable registration by selecting either the "User accounts may be registered" or "Both sites and user accounts can be registered" option on <a href="%s">this page</a>.', 'buddypress' ), network_admin_url( 'settings.php' ) );
     199                    printf(
     200                        /* translators: %s: the link to the Network settings page */
     201                        esc_html_x( 'Registration is currently disabled.  Before associating a page is allowed, please enable registration by selecting either the "User accounts may be registered" or "Both sites and user accounts can be registered" option on %s.', 'Disabled registration message for multisite config', 'buddypress' ),
     202                        sprintf(
     203                            '<a href="%1$s">%2$s</a>',
     204                            esc_url( network_admin_url( 'settings.php' ) ),
     205                            esc_html_x( 'this page', 'Link text for the Multisite’s network settings page', 'buddypress' )
     206                        )
     207                    );
    198208                    ?>
    199209                </p>
     
    201211                <p>
    202212                    <?php
    203                     /* translators: %s: the link to the Site settings page */
    204                     printf( __( 'Registration is currently disabled.  Before associating a page is allowed, please enable registration by clicking on the "Anyone can register" checkbox on <a href="%s">this page</a>.', 'buddypress' ), admin_url( 'options-general.php' ) );
     213                    printf(
     214                        /* translators: %s: the link to the Site general options page */
     215                        esc_html_x( 'Registration is currently disabled.  Before associating a page is allowed, please enable registration by clicking on the "Anyone can register" checkbox on %s.', 'Disabled registration message for regular site config', 'buddypress' ),
     216                        sprintf(
     217                            '<a href="%1$s">%2$s</a>',
     218                            esc_url( admin_url( 'options-general.php' ) ),
     219                            esc_html_x( 'this page', 'Link text for the Site’s general options page', 'buddypress' )
     220                        )
     221                    );
    205222                    ?>
    206223                </p>
     
    229246                            ) ) ?>
    230247
    231                             <?php if ( ! empty( $existing_pages[ $name ] ) && get_post( $existing_pages[ $name ] ) ) : ?>
    232 
    233                                 <a href="<?php echo get_permalink( $existing_pages[$name] ); ?>" class="button-secondary" target="_bp"><?php _e( 'View', 'buddypress' ); ?></a>
    234 
    235                             <?php endif; ?>
    236 
    237248                            <?php if ( ! bp_is_root_blog() ) restore_current_blog(); ?>
    238249
     
    267278
    268279    if ( isset( $_POST['bp-admin-pages-submit'] ) ) {
    269         if ( !check_admin_referer( 'bp-admin-pages-setup' ) )
     280        if ( ! check_admin_referer( 'bp-admin-pages-setup' ) ) {
    270281            return false;
     282        }
    271283
    272284        // Then, update the directory pages.
Note: See TracChangeset for help on using the changeset viewer.