Skip to:
Content

BuddyPress.org

Ticket #8291: 8291.patch

File 8291.patch, 2.5 KB (added by imath, 5 years ago)
  • src/bp-core/admin/bp-core-admin-functions.php

    diff --git src/bp-core/admin/bp-core-admin-functions.php src/bp-core/admin/bp-core-admin-functions.php
    index 5bb10b656..526591dcb 100644
    function bp_admin_do_wp_nav_menu_meta_box() { 
    783783        $tabs['loggedout']['label'] = __( 'Logged-Out', 'buddypress' );
    784784        $tabs['loggedout']['pages'] = bp_nav_menu_get_loggedout_pages();
    785785
     786        // Introduced in WordPress 5.3.0
     787        $is_wp_53_or_up  = function_exists( 'get_post_states' );
     788        $data_items_type = '';
     789        $select_all      = __( 'Select All', 'buddypress' );
     790        $menu_id         = 'buddypress-menu';
     791
     792        if ( $is_wp_53_or_up ) {
     793                $data_items_type = sprintf( 'data-items-type="posttype-%s"', esc_attr( $post_type_name ) );
     794                $menu_id         = 'posttype-buddypress';
     795        }
    786796        ?>
    787797
    788         <div id="buddypress-menu" class="posttypediv">
     798        <div id="<?php echo esc_attr( $menu_id ); ?>" class="posttypediv">
    789799                <h4><?php _e( 'Logged-In', 'buddypress' ); ?></h4>
    790800                <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>
    791801
    function bp_admin_do_wp_nav_menu_meta_box() { 
    815825                );
    816826                ?>
    817827
    818                 <p class="button-controls">
    819                         <span class="list-controls">
    820                                 <a href="
    821                                 <?php
    822                                 echo esc_url(
    823                                         add_query_arg(
    824                                                 array(
    825                                                         $post_type_name . '-tab' => 'all',
    826                                                         'selectall'              => 1,
    827                                                 ),
    828                                                 remove_query_arg( $removed_args )
    829                                         )
    830                                 );
    831                                 ?>
    832                                 #buddypress-menu" class="select-all"><?php _e( 'Select All', 'buddypress' ); ?></a>
    833                         </span>
     828                <?php printf( '<p class="button-controls wp-clearfix"%s>', $data_items_type ); ?>
     829                        <?php if ( $is_wp_53_or_up ) : ?>
     830                                <span class="list-controls hide-if-no-js">
     831                                        <input type="checkbox" id="<?php echo esc_attr( $post_type_name . '-tab' ); ?>" class="select-all" />
     832                                        <label for="<?php echo esc_attr( $post_type_name . '-tab' ); ?>"><?php echo esc_html( $select_all ); ?></label>
     833                                </span>
     834                        <?php else : ?>
     835                                <span class="list-controls">
     836                                        <a href="
     837                                        <?php
     838                                        echo esc_url(
     839                                                add_query_arg(
     840                                                        array(
     841                                                                $post_type_name . '-tab' => 'all',
     842                                                                'selectall'              => 1,
     843                                                        ),
     844                                                        remove_query_arg( $removed_args )
     845                                                )
     846                                        );
     847                                        ?>
     848                                        #buddypress-menu" class="select-all"><?php echo esc_html( $select_all ); ?></a>
     849                                </span>
     850                        <?php endif ;?>
     851
    834852                        <span class="add-to-menu">
    835853                                <input type="submit"
    836854                                <?php