Skip to:
Content

BuddyPress.org

Ticket #8197: 8197.patch

File 8197.patch, 21.1 KB (added by sharaz, 5 years ago)
  • src/bp-core/admin/bp-core-admin-functions.php

    ---
     src/bp-core/admin/bp-core-admin-functions.php | 235 ++++++++++--------
     1 file changed, 135 insertions(+), 100 deletions(-)
    
    diff --git a/src/bp-core/admin/bp-core-admin-functions.php b/src/bp-core/admin/bp-core-admin-functions.php
    index 2b6abea5f..8e19f2c12 100644
    a b defined( 'ABSPATH' ) || exit; 
    1414
    1515/**
    1616 * Initializes the wp-admin area "BuddyPress" menus and sub menus.
    17  *
    1817 */
    1918function bp_core_admin_menu_init() {
    2019        add_action( bp_core_admin_hook(), 'bp_core_add_admin_menu', 9 );
    function bp_core_modify_admin_menu_highlight() { 
    7776        global $plugin_page, $submenu_file;
    7877
    7978        // This tweaks the Settings subnav menu to show only one BuddyPress menu item.
    80         if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings', ) ) ) {
     79        if ( ! in_array( $plugin_page, array( 'bp-activity', 'bp-general-settings' ) ) ) {
    8180                $submenu_file = 'bp-components';
    8281        }
    8382
    function bp_core_admin_backpat_page() { 
    106105                <h2><?php _e( 'Why have all my BuddyPress menus disappeared?', 'buddypress' ); ?></h2>
    107106
    108107                <p><?php _e( "Don't worry! We've moved the BuddyPress options into more convenient and easier to find locations. You're seeing this page because you are running a legacy BuddyPress plugin which has not been updated.", 'buddypress' ); ?></p>
    109                 <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%s">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href="%s">Users</a> menu.', 'buddypress' ), esc_url( $settings_url ), bp_get_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p>
     108                <p><?php printf( __( 'Components, Pages, Settings, and Forums, have been moved to <a href="%1$s">Settings &gt; BuddyPress</a>. Profile Fields has been moved into the <a href="%2$s">Users</a> menu.', 'buddypress' ), esc_url( $settings_url ), bp_get_admin_url( 'users.php?page=bp-profile-setup' ) ); ?></p>
    110109        </div>
    111110
    112111        <?php
    function bp_core_admin_backpat_page() { 
    121120 * boxes.
    122121 *
    123122 * @since 1.5.0
    124  *
    125123 */
    126124function bp_core_print_admin_notices() {
    127125
    function bp_core_print_admin_notices() { 
    153151                printf( '</div>' );
    154152        }
    155153}
    156 add_action( 'admin_notices',         'bp_core_print_admin_notices' );
     154add_action( 'admin_notices', 'bp_core_print_admin_notices' );
    157155add_action( 'network_admin_notices', 'bp_core_print_admin_notices' );
    158156
    159157/**
    function bp_core_activation_notice() { 
    253251        $wp_page_components  = array();
    254252
    255253        // Only components with 'has_directory' require a WP page to function.
    256         foreach( array_keys( $bp->loaded_components ) as $component_id ) {
    257                 if ( !empty( $bp->{$component_id}->has_directory ) ) {
     254        foreach ( array_keys( $bp->loaded_components ) as $component_id ) {
     255                if ( ! empty( $bp->{$component_id}->has_directory ) ) {
    258256                        $wp_page_components[] = array(
    259257                                'id'   => $component_id,
    260                                 'name' => isset( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $bp->{$component_id}->id )
     258                                'name' => isset( $bp->{$component_id}->name ) ? $bp->{$component_id}->name : ucwords( $bp->{$component_id}->id ),
    261259                        );
    262260                }
    263261        }
    function bp_core_activation_notice() { 
    267265        if ( bp_get_signup_allowed() ) {
    268266                $wp_page_components[] = array(
    269267                        'id'   => 'activate',
    270                         'name' => __( 'Activate', 'buddypress' )
     268                        'name' => __( 'Activate', 'buddypress' ),
    271269                );
    272270
    273271                $wp_page_components[] = array(
    274272                        'id'   => 'register',
    275                         'name' => __( 'Register', 'buddypress' )
     273                        'name' => __( 'Register', 'buddypress' ),
    276274                );
    277275        }
    278276
    function bp_core_activation_notice() { 
    282280                $bp->pages = bp_core_get_directory_pages();
    283281        }
    284282
    285         foreach( $wp_page_components as $component ) {
    286                 if ( !isset( $bp->pages->{$component['id']} ) ) {
     283        foreach ( $wp_page_components as $component ) {
     284                if ( ! isset( $bp->pages->{$component['id']} ) ) {
    287285                        $orphaned_components[] = $component['name'];
    288286                }
    289287        }
    290288
    291         if ( !empty( $orphaned_components ) ) {
     289        if ( ! empty( $orphaned_components ) ) {
    292290                $admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
    293291                $notice    = sprintf(
    294292                        '%1$s <a href="%2$s">%3$s</a>',
    function bp_core_activation_notice() { 
    308306        $page_ids   = bp_core_get_directory_page_ids();
    309307        $dupes      = array_diff_assoc( $page_ids, array_unique( $page_ids ) );
    310308
    311         if ( !empty( $dupes ) ) {
    312                 foreach( array_keys( $dupes ) as $dupe_component ) {
     309        if ( ! empty( $dupes ) ) {
     310                foreach ( array_keys( $dupes ) as $dupe_component ) {
    313311                        $dupe_names[] = $bp->pages->{$dupe_component}->title;
    314312                }
    315313
    function bp_core_activation_notice() { 
    318316        }
    319317
    320318        // If there are duplicates, post a message about them.
    321         if ( !empty( $dupe_names ) ) {
     319        if ( ! empty( $dupe_names ) ) {
    322320                $admin_url = bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) );
    323321                $notice    = sprintf(
    324322                        '%1$s <a href="%2$s">%3$s</a>',
    function bp_core_activation_notice() { 
    340338 * @since 1.7.0
    341339 *
    342340 * @internal Used internally to redirect BuddyPress to the about page on activation.
    343  *
    344341 */
    345342function bp_do_activation_redirect() {
    346343
    function bp_core_admin_tabs( $active_tab = '' ) { 
    388385         *
    389386         * @param array $value Array of tabs to output to the admin area.
    390387         */
    391         $tabs         = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab ) );
     388        $tabs = apply_filters( 'bp_core_admin_tabs', bp_core_get_admin_tabs( $active_tab ) );
    392389
    393390        // Loop through tabs and build navigation.
    394391        foreach ( array_values( $tabs ) as $tab_data ) {
    function bp_core_get_admin_tabs( $active_tab = '' ) { 
    419416        $tabs = array(
    420417                '0' => array(
    421418                        'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-components' ), 'admin.php' ) ),
    422                         'name' => __( 'Components', 'buddypress' )
     419                        'name' => __( 'Components', 'buddypress' ),
    423420                ),
    424421                '2' => array(
    425422                        'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-settings' ), 'admin.php' ) ),
    426                         'name' => __( 'Options', 'buddypress' )
     423                        'name' => __( 'Options', 'buddypress' ),
    427424                ),
    428425                '1' => array(
    429426                        'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-page-settings' ), 'admin.php' ) ),
    430                         'name' => __( 'Pages', 'buddypress' )
     427                        'name' => __( 'Pages', 'buddypress' ),
    431428                ),
    432429                '3' => array(
    433430                        'href' => bp_get_admin_url( add_query_arg( array( 'page' => 'bp-credits' ), 'admin.php' ) ),
    434                         'name' => __( 'Credits', 'buddypress' )
     431                        'name' => __( 'Credits', 'buddypress' ),
    435432                ),
    436433        );
    437434
    function bp_core_add_contextual_help( $screen = '' ) { 
    462459        switch ( $screen->id ) {
    463460
    464461                // Component page.
    465                 case 'settings_page_bp-components' :
    466 
     462                case 'settings_page_bp-components':
    467463                        // Help tabs.
    468                         $screen->add_help_tab( array(
    469                                 'id'      => 'bp-comp-overview',
    470                                 'title'   => __( 'Overview', 'buddypress' ),
    471                                 'content' => bp_core_add_contextual_help_content( 'bp-comp-overview' ),
    472                         ) );
     464                        $screen->add_help_tab(
     465                                array(
     466                                        'id'      => 'bp-comp-overview',
     467                                        'title'   => __( 'Overview', 'buddypress' ),
     468                                        'content' => bp_core_add_contextual_help_content( 'bp-comp-overview' ),
     469                                )
     470                        );
    473471
    474472                        // Help panel - sidebar links.
    475473                        $screen->set_help_sidebar(
    function bp_core_add_contextual_help( $screen = '' ) { 
    480478                        break;
    481479
    482480                // Pages page.
    483                 case 'settings_page_bp-page-settings' :
    484 
     481                case 'settings_page_bp-page-settings':
    485482                        // Help tabs.
    486                         $screen->add_help_tab( array(
    487                                 'id' => 'bp-page-overview',
    488                                 'title' => __( 'Overview', 'buddypress' ),
    489                                 'content' => bp_core_add_contextual_help_content( 'bp-page-overview' ),
    490                         ) );
     483                        $screen->add_help_tab(
     484                                array(
     485                                        'id'      => 'bp-page-overview',
     486                                        'title'   => __( 'Overview', 'buddypress' ),
     487                                        'content' => bp_core_add_contextual_help_content( 'bp-page-overview' ),
     488                                )
     489                        );
    491490
    492491                        // Help panel - sidebar links.
    493492                        $screen->set_help_sidebar(
    function bp_core_add_contextual_help( $screen = '' ) { 
    499498                        break;
    500499
    501500                // Settings page.
    502                 case 'settings_page_bp-settings' :
    503 
     501                case 'settings_page_bp-settings':
    504502                        // Help tabs.
    505                         $screen->add_help_tab( array(
    506                                 'id'      => 'bp-settings-overview',
    507                                 'title'   => __( 'Overview', 'buddypress' ),
    508                                 'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ),
    509                         ) );
     503                        $screen->add_help_tab(
     504                                array(
     505                                        'id'      => 'bp-settings-overview',
     506                                        'title'   => __( 'Overview', 'buddypress' ),
     507                                        'content' => bp_core_add_contextual_help_content( 'bp-settings-overview' ),
     508                                )
     509                        );
    510510
    511511                        // Help panel - sidebar links.
    512512                        $screen->set_help_sidebar(
    function bp_core_add_contextual_help( $screen = '' ) { 
    518518                        break;
    519519
    520520                // Profile fields page.
    521                 case 'users_page_bp-profile-setup' :
    522 
     521                case 'users_page_bp-profile-setup':
    523522                        // Help tabs.
    524                         $screen->add_help_tab( array(
    525                                 'id'      => 'bp-profile-overview',
    526                                 'title'   => __( 'Overview', 'buddypress' ),
    527                                 'content' => bp_core_add_contextual_help_content( 'bp-profile-overview' ),
    528                         ) );
     523                        $screen->add_help_tab(
     524                                array(
     525                                        'id'      => 'bp-profile-overview',
     526                                        'title'   => __( 'Overview', 'buddypress' ),
     527                                        'content' => bp_core_add_contextual_help_content( 'bp-profile-overview' ),
     528                                )
     529                        );
    529530
    530531                        // Help panel - sidebar links.
    531532                        $screen->set_help_sidebar(
    add_action( 'load-users_page_bp-profile-setup', 'bp_core_add_contextual_help' ); 
    553554function bp_core_add_contextual_help_content( $tab = '' ) {
    554555
    555556        switch ( $tab ) {
    556                 case 'bp-comp-overview' :
     557                case 'bp-comp-overview':
    557558                        $retval = __( 'By default, all but four of the BuddyPress components are enabled. You can selectively enable or disable any of the components by using the form below. Your BuddyPress installation will continue to function. However, the features of the disabled components will no longer be accessible to anyone using the site.', 'buddypress' );
    558559                        break;
    559560
    560                 case 'bp-page-overview' :
     561                case 'bp-page-overview':
    561562                        $retval = __( 'BuddyPress Components use WordPress Pages for their root directory/archive pages. You can change the page associations for each active component by using the form below.', 'buddypress' );
    562563                        break;
    563564
    564                 case 'bp-settings-overview' :
     565                case 'bp-settings-overview':
    565566                        $retval = __( 'Extra configuration settings are provided and activated. You can selectively enable or disable any setting by using the form on this screen.', 'buddypress' );
    566567                        break;
    567568
    568                 case 'bp-profile-overview' :
     569                case 'bp-profile-overview':
    569570                        $retval = __( 'Your users will distinguish themselves through their profile page. Create relevant profile fields that will show on each users profile.', 'buddypress' ) . '<br /><br />' . __( 'Note: Any fields in the first group will appear on the signup page.', 'buddypress' );
    570571                        break;
    571572
    function bp_core_add_contextual_help_content( $tab = '' ) { 
    575576        }
    576577
    577578        // Wrap text in a paragraph tag.
    578         if ( !empty( $retval ) ) {
     579        if ( ! empty( $retval ) ) {
    579580                $retval = '<p>' . $retval . '</p>';
    580581        }
    581582
    function bp_core_add_contextual_help_content( $tab = '' ) { 
    588589 * Add a separator to the WordPress admin menus.
    589590 *
    590591 * @since 1.7.0
    591  *
    592592 */
    593593function bp_admin_separator() {
    594594
    function bp_admin_menu_order( $menu_order = array() ) { 
    655655        $bp_menu_order = array();
    656656
    657657        // Menu values.
    658         $last_sep     = is_network_admin() ? 'separator1' : 'separator2';
     658        $last_sep = is_network_admin() ? 'separator1' : 'separator2';
    659659
    660660        /**
    661661         * Filters the custom admin menus.
    function bp_admin_menu_order( $menu_order = array() ) { 
    681681                if ( $last_sep == $item ) {
    682682
    683683                        // Add our custom menus.
    684                         foreach( (array) $custom_menus as $custom_menu ) {
     684                        foreach ( (array) $custom_menus as $custom_menu ) {
    685685                                if ( array_search( $custom_menu, $menu_order ) ) {
    686686                                        $bp_menu_order[] = $custom_menu;
    687687                                }
    function bp_admin_menu_order( $menu_order = array() ) { 
    690690                        // Add the appearance separator.
    691691                        $bp_menu_order[] = $last_sep;
    692692
    693                 // Skip our menu items.
     693                        // Skip our menu items.
    694694                } elseif ( ! in_array( $item, $custom_menus ) ) {
    695695                        $bp_menu_order[] = $item;
    696696                }
    function bp_admin_list_table_current_bulk_action() { 
    718718        $action = ! empty( $_REQUEST['action'] ) ? $_REQUEST['action'] : '';
    719719
    720720        // If the bottom is set, let it override the action.
    721         if ( ! empty( $_REQUEST['action2'] ) && $_REQUEST['action2'] != "-1" ) {
     721        if ( ! empty( $_REQUEST['action2'] ) && $_REQUEST['action2'] != '-1' ) {
    722722                $action = $_REQUEST['action2'];
    723723        }
    724724
    function bp_admin_do_wp_nav_menu_meta_box() { 
    759759
    760760        $tabs = array();
    761761
    762         $tabs['loggedin']['label']  = __( 'Logged-In', 'buddypress' );
    763         $tabs['loggedin']['pages']  = bp_nav_menu_get_loggedin_pages();
     762        $tabs['loggedin']['label'] = __( 'Logged-In', 'buddypress' );
     763        $tabs['loggedin']['pages'] = bp_nav_menu_get_loggedin_pages();
    764764
    765765        $tabs['loggedout']['label'] = __( 'Logged-Out', 'buddypress' );
    766766        $tabs['loggedout']['pages'] = bp_nav_menu_get_loggedout_pages();
    function bp_admin_do_wp_nav_menu_meta_box() { 
    768768        ?>
    769769
    770770        <div id="buddypress-menu" class="posttypediv">
    771                 <h4><?php _e( 'Logged-In', 'buddypress' ) ?></h4>
    772                 <p><?php _e( '<em>Logged-In</em> links are relative to the current user, and are not visible to visitors who are not logged in.', 'buddypress' ) ?></p>
     771                <h4><?php _e( 'Logged-In', 'buddypress' ); ?></h4>
     772                <p><?php _e( '<em>Logged-In</em> links are relative to the current user, and are not visible to visitors who are not logged in.', 'buddypress' ); ?></p>
    773773
    774774                <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedin" class="tabs-panel tabs-panel-active">
    775775                        <ul id="buddypress-menu-checklist-loggedin" class="categorychecklist form-no-clear">
    776                                 <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedin']['pages'] ), 0, (object) $args );?>
     776                                <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedin']['pages'] ), 0, (object) $args ); ?>
    777777                        </ul>
    778778                </div>
    779779
    780                 <h4><?php _e( 'Logged-Out', 'buddypress' ) ?></h4>
    781                 <p><?php _e( '<em>Logged-Out</em> links are not visible to users who are logged in.', 'buddypress' ) ?></p>
     780                <h4><?php _e( 'Logged-Out', 'buddypress' ); ?></h4>
     781                <p><?php _e( '<em>Logged-Out</em> links are not visible to users who are logged in.', 'buddypress' ); ?></p>
    782782
    783783                <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedout" class="tabs-panel tabs-panel-active">
    784784                        <ul id="buddypress-menu-checklist-loggedout" class="categorychecklist form-no-clear">
    785                                 <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedout']['pages'] ), 0, (object) $args );?>
     785                                <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedout']['pages'] ), 0, (object) $args ); ?>
    786786                        </ul>
    787787                </div>
    788788
    function bp_admin_do_wp_nav_menu_meta_box() { 
    799799
    800800                <p class="button-controls">
    801801                        <span class="list-controls">
    802                                 <a href="<?php
    803                                 echo esc_url( add_query_arg(
    804                                         array(
    805                                                 $post_type_name . '-tab' => 'all',
    806                                                 'selectall'              => 1,
    807                                         ),
    808                                         remove_query_arg( $removed_args )
    809                                 ) );
    810                                 ?>#buddypress-menu" class="select-all"><?php _e( 'Select All', 'buddypress' ); ?></a>
     802                                <a href="
     803                                <?php
     804                                echo esc_url(
     805                                        add_query_arg(
     806                                                array(
     807                                                        $post_type_name . '-tab' => 'all',
     808                                                        'selectall'              => 1,
     809                                                ),
     810                                                remove_query_arg( $removed_args )
     811                                        )
     812                                );
     813                                ?>
     814                                #buddypress-menu" class="select-all"><?php _e( 'Select All', 'buddypress' ); ?></a>
    811815                        </span>
    812816                        <span class="add-to-menu">
    813                                 <input type="submit"<?php if ( function_exists( 'wp_nav_menu_disabled_check' ) ) : wp_nav_menu_disabled_check( $nav_menu_selected_id ); endif; ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu', 'buddypress' ); ?>" name="add-custom-menu-item" id="submit-buddypress-menu" />
     817                                <input type="submit"
     818                                <?php
     819                                if ( function_exists( 'wp_nav_menu_disabled_check' ) ) :
     820                                        wp_nav_menu_disabled_check( $nav_menu_selected_id );
     821endif;
     822                                ?>
     823                                 class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( 'Add to Menu', 'buddypress' ); ?>" name="add-custom-menu-item" id="submit-buddypress-menu" />
    814824                                <span class="spinner"></span>
    815825                        </span>
    816826                </p>
    add_action( 'admin_head-post.php', 'bp_admin_email_add_codex_notice' ); 
    891901 */
    892902function bp_email_tax_type_metabox( $post, $box ) {
    893903        $r = array(
    894                 'taxonomy' => bp_get_email_tax_type()
     904                'taxonomy' => bp_get_email_tax_type(),
    895905        );
    896906
    897907        $tax_name = esc_attr( $r['taxonomy'] );
    function bp_email_tax_type_metabox( $post, $box ) { 
    904914                        echo "<input type='hidden' name='{$name}[]' value='0' />"; // Allows for an empty term set to be sent. 0 is an invalid Term ID and will be ignored by empty() checks.
    905915                        ?>
    906916                        <ul id="<?php echo $tax_name; ?>checklist" data-wp-lists="list:<?php echo $tax_name; ?>" class="categorychecklist form-no-clear">
    907                                 <?php wp_terms_checklist( $post->ID, array( 'taxonomy' => $tax_name, 'walker' => new BP_Walker_Category_Checklist ) ); ?>
     917                                <?php
     918                                wp_terms_checklist(
     919                                        $post->ID,
     920                                        array(
     921                                                'taxonomy' => $tax_name,
     922                                                'walker'   => new BP_Walker_Category_Checklist(),
     923                                        )
     924                                );
     925                                ?>
    908926                        </ul>
    909927                </div>
    910928
    add_action( 'add_meta_boxes_' . bp_get_email_post_type(), 'bp_email_custom_metab 
    935953 * @param WP_Post $post
    936954 */
    937955function bp_email_plaintext_metabox( $post ) {
    938 ?>
     956        ?>
    939957
    940         <label class="screen-reader-text" for="excerpt"><?php
     958        <label class="screen-reader-text" for="excerpt">
     959        <?php
    941960                /* translators: accessibility text */
    942961                _e( 'Plain text email content', 'buddypress' );
    943         ?></label><textarea rows="5" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
     962        ?>
     963        </label><textarea rows="5" cols="40" name="excerpt" id="excerpt"><?php echo $post->post_excerpt; // textarea_escaped ?></textarea>
    944964
    945965        <p><?php _e( 'Most email clients support HTML email. However, some people prefer to receive plain text email. Enter a plain text alternative version of your email here.', 'buddypress' ); ?></p>
    946966
    947 <?php
     967        <?php
    948968}
    949969
    950970/**
    function bp_email_plaintext_metabox( $post ) { 
    964984 * @since 1.9.0
    965985 */
    966986function bp_admin_wp_nav_menu_restrict_items() {
    967 ?>
     987        ?>
    968988        <script type="text/javascript">
    969989        jQuery( '#menu-to-edit').on( 'click', 'a.item-edit', function() {
    970990                var settings  = jQuery(this).closest( '.menu-item-bar' ).next( '.menu-item-settings' );
    function bp_admin_wp_nav_menu_restrict_items() { 
    976996                }
    977997        });
    978998        </script>
    979 <?php
     999        <?php
    9801000}
    9811001
    9821002/**
    function bp_core_admin_user_row_actions( $actions, $user_object ) { 
    9921012
    9931013        // Setup the $user_id variable from the current user object.
    9941014        $user_id = 0;
    995         if ( !empty( $user_object->ID ) ) {
     1015        if ( ! empty( $user_object->ID ) ) {
    9961016                $user_id = absint( $user_object->ID );
    9971017        }
    9981018
    function bp_core_admin_user_row_actions( $actions, $user_object ) { 
    10041024
    10051025                // If spammed, create unspam link.
    10061026                if ( bp_is_user_spammer( $user_id ) ) {
    1007                         $url             = add_query_arg( array( 'action' => 'ham', 'user' => $user_id ), $url );
    1008                         $unspam_link     = wp_nonce_url( $url, 'bp-spam-user' );
    1009                         $actions['ham']  = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $unspam_link ), esc_html__( 'Not Spam', 'buddypress' ) );
     1027                        $url            = add_query_arg(
     1028                                array(
     1029                                        'action' => 'ham',
     1030                                        'user'   => $user_id,
     1031                                ),
     1032                                $url
     1033                        );
     1034                        $unspam_link    = wp_nonce_url( $url, 'bp-spam-user' );
     1035                        $actions['ham'] = sprintf( '<a href="%1$s">%2$s</a>', esc_url( $unspam_link ), esc_html__( 'Not Spam', 'buddypress' ) );
    10101036
    1011                 // If not already spammed, create spam link.
     1037                        // If not already spammed, create spam link.
    10121038                } else {
    1013                         $url             = add_query_arg( array( 'action' => 'spam', 'user' => $user_id ), $url );
     1039                        $url             = add_query_arg(
     1040                                array(
     1041                                        'action' => 'spam',
     1042                                        'user'   => $user_id,
     1043                                ),
     1044                                $url
     1045                        );
    10141046                        $spam_link       = wp_nonce_url( $url, 'bp-spam-user' );
    10151047                        $actions['spam'] = sprintf( '<a class="submitdelete" href="%1$s">%2$s</a>', esc_url( $spam_link ), esc_html__( 'Spam', 'buddypress' ) );
    10161048                }
    add_filter( 'admin_body_class', 'bp_core_admin_body_classes' ); 
    11411173 *
    11421174 * @since 5.0.0
    11431175 *
    1144  * @param array   $categories Array of block categories.
    1145  * @param object  $post       Post being loaded.
     1176 * @param array  $categories Array of block categories.
     1177 * @param object $post       Post being loaded.
    11461178 */
    11471179function bp_block_category( $categories = array(), $post = null ) {
    11481180        if ( ! ( $post instanceof WP_Post ) ) {
    function bp_block_category( $categories = array(), $post = null ) { 
    11691201                return $categories;
    11701202        }
    11711203
    1172         return array_merge( $categories, array(
     1204        return array_merge(
     1205                $categories,
    11731206                array(
    1174                         'slug'  => 'buddypress',
    1175                         'title' => __( 'BuddyPress', 'buddypress' ),
    1176                         'icon'  => 'buddicons-buddypress-logo',
    1177                 ),
    1178         ) );
     1207                        array(
     1208                                'slug'  => 'buddypress',
     1209                                'title' => __( 'BuddyPress', 'buddypress' ),
     1210                                'icon'  => 'buddicons-buddypress-logo',
     1211                        ),
     1212                )
     1213        );
    11791214}
    11801215add_filter( 'block_categories', 'bp_block_category', 1, 2 );