Skip to:
Content

BuddyPress.org

Changeset 13118


Ignore:
Timestamp:
10/07/2021 01:49:37 PM (3 years ago)
Author:
dcavins
Message:

Introduce bp_allow_access_to_registration_pages().

Add core function to determine whether
registration and activation pages should be created.

Fixes #8580.

Location:
trunk/src
Files:
4 edited

Legend:

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

    r12956 r13118  
    285285    // Activate and Register are special cases. They are not components but they need WP pages.
    286286    // If user registration is disabled, we can skip this step.
    287     if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) {
     287    if ( bp_allow_access_to_registration_pages() ) {
    288288        $wp_page_components[] = array(
    289289            'id'   => 'activate',
  • trunk/src/bp-core/admin/bp-core-admin-slugs.php

    r12991 r13118  
    188188        <h3><?php esc_html_e( 'Registration', 'buddypress' ); ?></h3>
    189189
    190         <?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : ?>
     190        <?php if ( bp_allow_access_to_registration_pages() ) : ?>
    191191            <p>
    192192                <?php esc_html_e( 'Associate WordPress Pages with the following BuddyPress Registration pages.', 'buddypress' ); ?>
     
    228228            <tbody>
    229229
    230                 <?php if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) : foreach ( $static_pages as $name => $label ) : ?>
     230                <?php if ( bp_allow_access_to_registration_pages() ) : foreach ( $static_pages as $name => $label ) : ?>
    231231
    232232                    <tr valign="top">
  • trunk/src/bp-core/bp-core-functions.php

    r13108 r13118  
    703703    // Register and Activate are not components, but need pages when
    704704    // registration is enabled.
    705     if ( bp_get_signup_allowed() || bp_get_members_invitations_allowed() ) {
     705    if ( bp_allow_access_to_registration_pages() ) {
    706706        foreach ( array( 'register', 'activate' ) as $slug ) {
    707707            if ( ! isset( $pages[ $slug ] ) ) {
  • trunk/src/bp-members/bp-members-template.php

    r13108 r13118  
    29272927
    29282928/**
     2929 * Should the system create and allow access
     2930 * to the Register and Activate pages?
     2931 *
     2932 * @since 10.0.0
     2933 *
     2934 * @return bool
     2935 */
     2936function bp_allow_access_to_registration_pages() {
     2937    $retval = bp_get_signup_allowed() || bp_get_members_invitations_allowed();
     2938
     2939    /**
     2940     * Filters whether or not the system should create and allow access
     2941     * to the Register and Activate pages.
     2942     *
     2943     * @since 10.0.0
     2944     *
     2945     * @param bool $retval Whether or not to allow access to
     2946     *                     the Register and Activate pages.
     2947     */
     2948    return apply_filters( 'bp_allow_access_to_registration_pages', $retval );
     2949}
     2950
     2951/**
    29292952 * Hook member activity feed to <head>.
    29302953 *
Note: See TracChangeset for help on using the changeset viewer.