Skip to:
Content

BuddyPress.org


Ignore:
Timestamp:
07/04/2020 11:42:49 AM (4 years ago)
Author:
imath
Message:

Administration: improve how BP Member Nav Menu items are managed

Since WordPress 5.3, the WP nav menu meta boxes had their output modified to improve a11y. The most visible improvement was to use a checkbox to select all box's current panel menu items instead of a link. This change also modified the JavaScript causing the BP Member nav menu meta box to fail at selecting all menu items.

As we support WordPress versions that are older than 5.3, we had to review the way we were extending the Accordion Menu box so that we can enjoy WP 5.3 improvements and keeps on being back compatible with previous versions of WordPress.

As this new way does not need the BP_Walker_Nav_Menu_Checklist class anymore, we are deprecating the class's corresponding file without removing the class from our Classes Autoloader in case some plugin developers are using it directly.

Once we will be sure no plugin developers are using it directly, we will need to delete the class's file and remove the class from our Classes Autoloader.

Props vapvarun

Fixes #8291

File:
1 edited

Legend:

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

    r12588 r12678  
    692692function bp_setup_nav_menu_item( $menu_item ) {
    693693    if ( is_admin() ) {
     694        if ( 'bp_nav_menu_item' === $menu_item->object ) {
     695            $menu_item->type = 'custom';
     696            $menu_item->url  = $menu_item->guid;
     697
     698            if ( ! in_array( array( 'bp-menu', 'bp-'. $menu_item->post_excerpt .'-nav' ), $menu_item->classes ) ) {
     699                $menu_item->classes[] = 'bp-menu';
     700                $menu_item->classes[] = 'bp-'. $menu_item->post_excerpt .'-nav';
     701            }
     702        }
     703
    694704        return $menu_item;
    695705    }
Note: See TracChangeset for help on using the changeset viewer.