<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[BuddyPress][12678] trunk/src: Administration: improve how BP Member Nav Menu items are managed</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { white-space: pre-line; overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta" style="font-size: 105%">
<dt style="float: left; width: 6em; font-weight: bold">Revision</dt> <dd><a style="font-weight: bold" href="http://buddypress.trac.wordpress.org/changeset/12678">12678</a><script type="application/ld+json">{"@context":"http://schema.org","@type":"EmailMessage","description":"Review this Commit","action":{"@type":"ViewAction","url":"http://buddypress.trac.wordpress.org/changeset/12678","name":"Review Commit"}}</script></dd>
<dt style="float: left; width: 6em; font-weight: bold">Author</dt> <dd>imath</dd>
<dt style="float: left; width: 6em; font-weight: bold">Date</dt> <dd>2020-07-04 11:42:49 +0000 (Sat, 04 Jul 2020)</dd>
</dl>
<pre style='padding-left: 1em; margin: 2em 0; border-left: 2px solid #ccc; line-height: 1.25; font-size: 105%; font-family: sans-serif'>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 <a href="http://buddypress.trac.wordpress.org/ticket/8291">#8291</a></pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunksrcbpcoreadminbpcoreadminfunctionsphp">trunk/src/bp-core/admin/bp-core-admin-functions.php</a></li>
<li><a href="#trunksrcbpcorebpcorefiltersphp">trunk/src/bp-core/bp-core-filters.php</a></li>
<li><a href="#trunksrcbpcorebpcorefunctionsphp">trunk/src/bp-core/bp-core-functions.php</a></li>
<li><a href="#trunksrcbpcoreclassesclassbpwalkernavmenuchecklistphp">trunk/src/bp-core/classes/class-bp-walker-nav-menu-checklist.php</a></li>
<li><a href="#trunksrcclassbuddypressphp">trunk/src/class-buddypress.php</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunksrcbpcoreadminbpcoreadminfunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/admin/bp-core-admin-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/admin/bp-core-admin-functions.php 2020-07-04 10:26:59 UTC (rev 12677)
+++ trunk/src/bp-core/admin/bp-core-admin-functions.php 2020-07-04 11:42:49 UTC (rev 12678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -755,96 +755,167 @@
</span><span class="cx" style="display: block; padding: 0 10px"> return;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- add_meta_box( 'add-buddypress-nav-menu', __( 'BuddyPress', 'buddypress' ), 'bp_admin_do_wp_nav_menu_meta_box', 'nav-menus', 'side', 'default' );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ add_meta_box( 'add-buddypress-nav-menu', __( 'BuddyPress Member', 'buddypress' ), 'bp_admin_do_wp_nav_menu_meta_box', 'nav-menus', 'side', 'default' );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> add_action( 'admin_print_footer_scripts', 'bp_admin_wp_nav_menu_restrict_items' );
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * BP Member nav menu filter to short-circuit WP's query.
+ *
+ * @since 7.0.0
+ *
+ * @param null $null A null value.
+ * @param WP_Query $wp_query The WP_Query instance (passed by reference).
+ * @return array The BP Member nav items to short-circuit WP's query,
+ */
+function bp_admin_get_wp_nav_menu_items( $null = null, $wp_query ) {
+ if ( isset( $wp_query->query['orderby'], $wp_query->query['order'] ) && 'post_date' === $wp_query->query['orderby'] && 'DESC' === $wp_query->query['order'] ) {
+ return bp_nav_menu_get_loggedin_pages();
+ } elseif ( isset( $wp_query->query['nopaging'] ) && true === $wp_query->query['nopaging'] ) {
+ return array_merge( bp_nav_menu_get_loggedin_pages(), bp_nav_menu_get_loggedout_pages() );
+ }
+
+ return bp_nav_menu_get_loggedout_pages();
+}
+
+/**
</ins><span class="cx" style="display: block; padding: 0 10px"> * Build and populate the BuddyPress accordion on Appearance > Menus.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.9.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @since 7.0.0 Uses wp_nav_menu_item_post_type_meta_box()
</ins><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @global $nav_menu_selected_id
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">-function bp_admin_do_wp_nav_menu_meta_box() {
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+function bp_admin_do_wp_nav_menu_meta_box( $object = '', $box = array() ) {
</ins><span class="cx" style="display: block; padding: 0 10px"> global $nav_menu_selected_id;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $walker = new BP_Walker_Nav_Menu_Checklist( false );
- $args = array( 'walker' => $walker );
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $box['args'] = (object) array(
+ 'name' => 'bp_nav_menu_item',
+ '_default_query' => array(),
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $post_type_name = 'buddypress';
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Temporarly register a post type.
+ register_post_type(
+ 'bp_nav_menu_item',
+ array(
+ 'label' => 'BuddyPress',
+ 'labels' => array(
+ 'search_items' => __( 'Search BuddyPress member menu items', 'buddypress' ),
+ 'all_items' => __( 'All BuddyPress Member menu items', 'buddypress' ),
+ ),
+ 'public' => true,
+ 'hierarchical' => false,
+ 'has_archive' => false,
+ 'rewrite' => false,
+ )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tabs = array();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Temporarly override the posts query results.
+ add_filter( 'posts_pre_query', 'bp_admin_get_wp_nav_menu_items', 10, 2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tabs['loggedin']['label'] = __( 'Logged-In', 'buddypress' );
- $tabs['loggedin']['pages'] = bp_nav_menu_get_loggedin_pages();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ ob_start();
+ wp_nav_menu_item_post_type_meta_box( 'buddypress', $box );
+ $output = ob_get_clean();
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- $tabs['loggedout']['label'] = __( 'Logged-Out', 'buddypress' );
- $tabs['loggedout']['pages'] = bp_nav_menu_get_loggedout_pages();
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $get_bp_items = new WP_Query;
+ $all_bp_items = $get_bp_items->query( array( 'nopaging' => true ) );
+ $walker = new Walker_Nav_Menu_Checklist();
+ $all_bp_tabs = sprintf(
+ '<div id="bp_nav_menu_item-all" class="tabs-panel tabs-panel-view-all tabs-panel-inactive" role="region" aria-label="%1$s" tabindex="0">
+ <ul id="bp_nav_menu_itemchecklist" data-wp-lists="list:bp_nav_menu_item" class="categorychecklist form-no-clear">
+ %2$s
+ </ul>
+ </div>',
+ esc_html__( 'All BuddyPress Member menu items', 'buddypress' ),
+ walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $all_bp_items ), 0, (object) array( 'walker' => $walker ) )
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ // Remove temporary post type and filter.
+ unregister_post_type( 'bp_nav_menu_item' );
+ remove_filter( 'posts_pre_query', 'bp_admin_get_wp_nav_menu_items', 10, 2 );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div id="buddypress-menu" class="posttypediv">
- <h4><?php _e( 'Logged-In', 'buddypress' ); ?></h4>
- <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>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $tab_name = 'bp_nav_menu_item-tab';
+ $current_tab = 'logged-in';
+ $tabs = array(
+ 'logged-in' => __( 'Logged-In', 'buddypress' ),
+ 'logged-out' => __( 'Logged-Out', 'buddypress' ),
+ 'all' => __( 'All', 'buddypress' ),
+ );
+ $tab_urls = array(
+ 'all' => '',
+ 'logged-in' => '',
+ 'logged-out' => '',
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedin" class="tabs-panel tabs-panel-active">
- <ul id="buddypress-menu-checklist-loggedin" class="categorychecklist form-no-clear">
- <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedin']['pages'] ), 0, (object) $args ); ?>
- </ul>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( isset( $_REQUEST[ $tab_name ] ) && in_array( $_REQUEST[ $tab_name ], array_keys( $tabs ), true ) ) {
+ $current_tab = $_REQUEST[ $tab_name ];
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <h4><?php _e( 'Logged-Out', 'buddypress' ); ?></h4>
- <p><?php _e( '<em>Logged-Out</em> links are not visible to users who are logged in.', 'buddypress' ); ?></p>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $removed_args = array(
+ 'action',
+ 'customlink-tab',
+ 'edit-menu-item',
+ 'menu-item',
+ 'page-tab',
+ '_wpnonce',
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <div id="tabs-panel-posttype-<?php echo $post_type_name; ?>-loggedout" class="tabs-panel tabs-panel-active">
- <ul id="buddypress-menu-checklist-loggedout" class="categorychecklist form-no-clear">
- <?php echo walk_nav_menu_tree( array_map( 'wp_setup_nav_menu_item', $tabs['loggedout']['pages'] ), 0, (object) $args ); ?>
- </ul>
- </div>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( $nav_menu_selected_id ) {
+ $tab_urls['all'] = esc_url( add_query_arg( $tab_name, 'all', remove_query_arg( $removed_args ) ) );
+ $tab_urls['logged-in'] = esc_url( add_query_arg( $tab_name, 'logged-in', remove_query_arg( $removed_args ) ) );
+ $tab_urls['logged-out'] = esc_url( add_query_arg( $tab_name, 'logged-out', remove_query_arg( $removed_args ) ) );
+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php
- $removed_args = array(
- 'action',
- 'customlink-tab',
- 'edit-menu-item',
- 'menu-item',
- 'page-tab',
- '_wpnonce',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $bp_tabs_nav = '';
+ foreach ( $tabs as $tab => $tab_text ) {
+ $class = '';
+ $datatype = 'bp_nav_menu_item-' . $tab;
+
+ if ( $current_tab === $tab ) {
+ $class = ' class="tabs"';
+ }
+
+ if ( 'all' !== $tab ) {
+ $datatype = 'tabs-panel-posttype-bp_nav_menu_item-' . $tab;
+ }
+
+ $bp_tabs_nav .= sprintf(
+ '<li%1$s>
+ <a class="nav-tab-link" data-type="%2$s" href="%3$s">
+ %4$s
+ </a>
+ </li>',
+ $class,
+ $datatype,
+ esc_url( $tab_urls[ $tab ] ) . '#' . $datatype,
+ esc_html( $tab_text )
</ins><span class="cx" style="display: block; padding: 0 10px"> );
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- ?>
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ }
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <p class="button-controls">
- <span class="list-controls">
- <a href="
- <?php
- echo esc_url(
- add_query_arg(
- array(
- $post_type_name . '-tab' => 'all',
- 'selectall' => 1,
- ),
- remove_query_arg( $removed_args )
- )
- );
- ?>
- #buddypress-menu" class="select-all"><?php _e( 'Select All', 'buddypress' ); ?></a>
- </span>
- <span class="add-to-menu">
- <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" />
- <span class="spinner"></span>
- </span>
- </p>
- </div><!-- /#buddypress-menu -->
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ $output = str_replace(
+ array(
+ 'tabs-panel-posttype-bp_nav_menu_item-most-recent',
+ 'bp_nav_menu_itemchecklist-most-recent',
+ 'bp_nav_menu_item-all',
+ 'bp_nav_menu_itemchecklist',
+ ),
+ array(
+ 'tabs-panel-posttype-bp_nav_menu_item-logged-in',
+ 'bp_nav_menu_itemchecklist-logged-in',
+ 'tabs-panel-posttype-bp_nav_menu_item-logged-out',
+ 'bp_nav_menu_itemchecklist-logged-out',
+ ),
+ $output
+ );
</ins><span class="cx" style="display: block; padding: 0 10px">
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- <?php
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ preg_match( '/\<ul\sid=\"posttype-bp_nav_menu_item-tabs\"[^>]*>(.*?)\<\/ul\>\<!-- \.posttype-tabs --\>/s', $output, $tabs_nav );
+
+ if ( isset( $tabs_nav[1] ) ) {
+ $output = str_replace( $tabs_nav[1], $bp_tabs_nav, $output );
+ }
+
+ echo preg_replace( '/\<div\sclass=\".*\"\sid=\"tabs-panel-posttype-bp_nav_menu_item-search\"[^>]*>(.*?)\<\/div\>/s', $all_bp_tabs, $output );
</ins><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span></span></pre></div>
<a id="trunksrcbpcorebpcorefiltersphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-filters.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-filters.php 2020-07-04 10:26:59 UTC (rev 12677)
+++ trunk/src/bp-core/bp-core-filters.php 2020-07-04 11:42:49 UTC (rev 12678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -691,6 +691,16 @@
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function bp_setup_nav_menu_item( $menu_item ) {
</span><span class="cx" style="display: block; padding: 0 10px"> if ( is_admin() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ if ( 'bp_nav_menu_item' === $menu_item->object ) {
+ $menu_item->type = 'custom';
+ $menu_item->url = $menu_item->guid;
+
+ if ( ! in_array( array( 'bp-menu', 'bp-'. $menu_item->post_excerpt .'-nav' ), $menu_item->classes ) ) {
+ $menu_item->classes[] = 'bp-menu';
+ $menu_item->classes[] = 'bp-'. $menu_item->post_excerpt .'-nav';
+ }
+ }
+
</ins><span class="cx" style="display: block; padding: 0 10px"> return $menu_item;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="cx" style="display: block; padding: 0 10px">
</span></span></pre></div>
<a id="trunksrcbpcorebpcorefunctionsphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/bp-core-functions.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/bp-core-functions.php 2020-07-04 10:26:59 UTC (rev 12677)
+++ trunk/src/bp-core/bp-core-functions.php 2020-07-04 11:42:49 UTC (rev 12678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2580,7 +2580,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_author' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_date' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_excerpt' => $bp_item['slug'],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_type' => 'page',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_type' => 'bp_nav_menu_item',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_status' => 'closed',
</span><span class="cx" style="display: block; padding: 0 10px"> 'guid' => $bp_item['link']
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -2655,7 +2655,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_author' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_date' => 0,
</span><span class="cx" style="display: block; padding: 0 10px"> 'post_excerpt' => $bp_item['slug'],
</span><del style="background-color: #fdd; text-decoration:none; display:block; padding: 0 10px">- 'post_type' => 'page',
</del><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ 'post_type' => 'bp_nav_menu_item',
</ins><span class="cx" style="display: block; padding: 0 10px"> 'post_status' => 'publish',
</span><span class="cx" style="display: block; padding: 0 10px"> 'comment_status' => 'closed',
</span><span class="cx" style="display: block; padding: 0 10px"> 'guid' => $bp_item['link']
</span></span></pre></div>
<a id="trunksrcbpcoreclassesclassbpwalkernavmenuchecklistphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/bp-core/classes/class-bp-walker-nav-menu-checklist.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/bp-core/classes/class-bp-walker-nav-menu-checklist.php 2020-07-04 10:26:59 UTC (rev 12677)
+++ trunk/src/bp-core/classes/class-bp-walker-nav-menu-checklist.php 2020-07-04 11:42:49 UTC (rev 12678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -5,11 +5,15 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @package BuddyPress
</span><span class="cx" style="display: block; padding: 0 10px"> * @subpackage Core
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.9.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 7.0.0 This file is no longer used as of the improved way to generate BuddyPress Member's nav menu items in #8291.
+ * @todo Remove this file as it is no longer used.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> // Exit if accessed directly.
</span><span class="cx" style="display: block; padding: 0 10px"> defined( 'ABSPATH' ) || exit;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+_deprecated_file( basename( __FILE__ ), '7.0.0' );
+
</ins><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Create a set of BuddyPress-specific links for use in the Menus admin UI.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -17,6 +21,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * to require an actual post type or taxonomy, and to force certain CSS classes.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @since 1.9.0
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 7.0.0 This class is no longer used as of the improved way to generate BuddyPress Member's nav menu items in #8291.
</ins><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> class BP_Walker_Nav_Menu_Checklist extends Walker_Nav_Menu {
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -23,11 +28,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Constructor.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 7.0.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see Walker_Nav_Menu::__construct() for a description of parameters.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array|bool $fields See {@link Walker_Nav_Menu::__construct()}.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function __construct( $fields = false ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _deprecated_function( __METHOD__, '7.0.0' );
</ins><span class="cx" style="display: block; padding: 0 10px"> if ( $fields ) {
</span><span class="cx" style="display: block; padding: 0 10px"> $this->db_fields = $fields;
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -36,6 +44,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Create the markup to start a tree level.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 7.0.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see Walker_Nav_Menu::start_lvl() for description of parameters.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $output See {@Walker_Nav_Menu::start_lvl()}.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -43,6 +53,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args See {@Walker_Nav_Menu::start_lvl()}.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function start_lvl( &$output, $depth = 0, $args = array() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _deprecated_function( __METHOD__, '7.0.0' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $indent = str_repeat( "\t", $depth );
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= "\n$indent<ul class='children'>\n";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -50,6 +61,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Create the markup to end a tree level.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 7.0.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see Walker_Nav_Menu::end_lvl() for description of parameters.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $output See {@Walker_Nav_Menu::end_lvl()}.
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -57,6 +70,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param array $args See {@Walker_Nav_Menu::end_lvl()}.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> public function end_lvl( &$output, $depth = 0, $args = array() ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _deprecated_function( __METHOD__, '7.0.0' );
</ins><span class="cx" style="display: block; padding: 0 10px"> $indent = str_repeat( "\t", $depth );
</span><span class="cx" style="display: block; padding: 0 10px"> $output .= "\n$indent</ul>";
</span><span class="cx" style="display: block; padding: 0 10px"> }
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -64,6 +78,8 @@
</span><span class="cx" style="display: block; padding: 0 10px"> /**
</span><span class="cx" style="display: block; padding: 0 10px"> * Create the markup to start an element.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ * @deprecated 7.0.0
+ *
</ins><span class="cx" style="display: block; padding: 0 10px"> * @see Walker::start_el() for description of parameters.
</span><span class="cx" style="display: block; padding: 0 10px"> *
</span><span class="cx" style="display: block; padding: 0 10px"> * @param string $output Passed by reference. Used to append additional
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -74,6 +90,7 @@
</span><span class="cx" style="display: block; padding: 0 10px"> * @param int $id See {@Walker::start_el()}.
</span><span class="cx" style="display: block; padding: 0 10px"> */
</span><span class="cx" style="display: block; padding: 0 10px"> function start_el( &$output, $item, $depth = 0, $args = array(), $id = 0 ) {
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ _deprecated_function( __METHOD__, '7.0.0' );
</ins><span class="cx" style="display: block; padding: 0 10px"> global $_nav_menu_placeholder;
</span><span class="cx" style="display: block; padding: 0 10px">
</span><span class="cx" style="display: block; padding: 0 10px"> $_nav_menu_placeholder = ( 0 > $_nav_menu_placeholder ) ? intval($_nav_menu_placeholder) - 1 : -1;
</span></span></pre></div>
<a id="trunksrcclassbuddypressphp"></a>
<div class="modfile"><h4 style="background-color: #eee; color: inherit; margin: 1em 0; padding: 1.3em; font-size: 115%">Modified: trunk/src/class-buddypress.php</h4>
<pre class="diff"><span>
<span class="info" style="display: block; padding: 0 10px; color: #888">--- trunk/src/class-buddypress.php 2020-07-04 10:26:59 UTC (rev 12677)
+++ trunk/src/class-buddypress.php 2020-07-04 11:42:49 UTC (rev 12678)
</span><span class="lines" style="display: block; padding: 0 10px; color: #888">@@ -577,6 +577,14 @@
</span><span class="cx" style="display: block; padding: 0 10px"> 'BP_Theme_Compat' => 'core',
</span><span class="cx" style="display: block; padding: 0 10px"> 'BP_User_Query' => 'core',
</span><span class="cx" style="display: block; padding: 0 10px"> 'BP_Walker_Category_Checklist' => 'core',
</span><ins style="background-color: #dfd; text-decoration:none; display:block; padding: 0 10px">+ /**
+ * BP_Walker_Nav_Menu_Checklist class.
+ *
+ * As this class corresponding file is deprecated, it will trigger a deprecation notice if instantiated.
+ * In a subsequent release, we'll remove it from our Classes Autoloader.
+ *
+ * @todo Remove the BP_Walker_Nav_Menu_Checklist from our Classes Autoloader.
+ */
</ins><span class="cx" style="display: block; padding: 0 10px"> 'BP_Walker_Nav_Menu_Checklist' => 'core',
</span><span class="cx" style="display: block; padding: 0 10px"> 'BP_Walker_Nav_Menu' => 'core',
</span><span class="cx" style="display: block; padding: 0 10px"> 'BP_Invitation_Manager' => 'core',
</span></span></pre>
</div>
</div>
</body>
</html>