Skip to:
Content

BuddyPress.org

Changeset 12899


Ignore:
Timestamp:
04/20/2021 04:03:08 PM (4 years ago)
Author:
dcavins
Message:

BP_Optouts: Add WP Admin management screen.

Add a management screen for opt-out requests at the
single-site or network level. This screen is appended
to the BuddyPress Tools screen. Using this screen,
site admins can view opt-out requests, search for
opt-outs by specific email address, and monitor
opt-out requests for signs of abuse by a particular
email type or potentially malicious user.

Fixes #8448.

Location:
trunk/src
Files:
2 added
5 edited

Legend:

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

    r12897 r12899  
    8484    if ( in_array( $plugin_page, array( 'bp-tools', 'available-tools' ) ) ) {
    8585        $submenu_file = $plugin_page;
     86    }
     87
     88    // Keep the BuddyPress tools menu highlighted.
     89    if ( 'bp-optouts' === $plugin_page ) {
     90        $submenu_file = 'bp-tools';
    8691    }
    8792}
     
    474479                'name' => __( 'Repair', 'buddypress' ),
    475480            ),
     481            '1' => array(
     482                'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-optouts' ), $tools_page ) ),
     483                'name' => __( 'Manage Opt-outs', 'buddypress' ),
     484            ),
    476485        );
    477486    }
  • trunk/src/bp-core/admin/bp-core-admin-tools.php

    r12897 r12899  
    556556                    esc_html_x( 'Use the %s to repair these relationships.', 'buddypress tools intro', 'buddypress' ),
    557557                    '<a href="' . esc_url( $url ) . '">' . esc_html__( 'BuddyPress Repair Tools', 'buddypress' ) . '</a>'
     558                );
     559                ?>
     560            </dd>
     561            <dt><?php esc_html_e( 'Manage Opt-outs', 'buddypress' ) ?></dt>
     562            <dd>
     563                <?php esc_html_e( 'BuddyPress stores opt-out requests from people who are not members of this site, but have been contacted via communication from this site, and wish to opt-out from future communication.', 'buddypress' ); ?>
     564                <?php
     565                $url = add_query_arg( 'page', 'bp-optouts', bp_get_admin_url( $page ) );
     566                printf(
     567                    /* translators: %s: the link to the BuddyPress Nonmember Opt-outs */
     568                    esc_html_x( 'Visit %s to manage your site&rsquo;s opt-out requests.', 'buddypress opt-outs intro', 'buddypress' ),
     569                    '<a href="' . esc_url( $url ) . '">' . esc_html__( 'Nonmember Opt-outs', 'buddypress' ) . '</a>'
    558570                );
    559571                ?>
  • trunk/src/bp-core/classes/class-bp-admin.php

    r12893 r12899  
    124124        require( $this->admin_dir . 'bp-core-admin-slugs.php'      );
    125125        require( $this->admin_dir . 'bp-core-admin-tools.php'      );
     126        require( $this->admin_dir . 'bp-core-admin-optouts.php'    );
    126127    }
    127128
     
    302303        );
    303304
     305        $hooks[] = add_submenu_page(
     306            $tools_parent,
     307            __( 'Manage Opt-outs', 'buddypress' ),
     308            __( 'Manage Opt-outs', 'buddypress' ),
     309            $this->capability,
     310            'bp-optouts',
     311            'bp_core_optouts_admin'
     312        );
     313
    304314        // For network-wide configs, add a link to (the root site's) Emails screen.
    305315        if ( is_network_admin() && bp_is_network_activated() ) {
     
    524534        remove_submenu_page( 'index.php', 'bp-about'   );
    525535        remove_submenu_page( 'index.php', 'bp-credits' );
     536
     537        // Nonmembers Opt-outs page.
     538        if ( is_network_admin() ) {
     539            remove_submenu_page( 'network-tools', 'bp-optouts' );
     540        } else {
     541            remove_submenu_page( 'tools.php', 'bp-optouts' );
     542        }
    526543    }
    527544
  • trunk/src/bp-members/classes/class-bp-members-admin.php

    r12778 r12899  
    510510            $this->users_page   .= '-network';
    511511            $this->signups_page .= '-network';
     512
     513            $this->members_optouts_page .= '-network';
    512514        }
    513515
  • trunk/src/class-buddypress.php

    r12898 r12899  
    599599            'BP_Admin_Types'               => 'core',
    600600            'BP_Optout'                    => 'core',
     601            'BP_Optouts_List_Table'        => 'core',
    601602
    602603            'BP_Core_Friends_Widget'   => 'friends',
Note: See TracChangeset for help on using the changeset viewer.