Networks and Sites: Don't display an empty Menu Settings section in network admin if there are no items.

This accounts for returning an empty array from the `mu_menu_items` filter.

Props dlh.
Fixes #49977.
Built from https://develop.svn.wordpress.org/trunk@47616


git-svn-id: http://core.svn.wordpress.org/trunk@47391 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2020-04-23 18:58:05 +00:00
parent b6c70b7712
commit 0dc461c72e
2 changed files with 40 additions and 34 deletions

View File

@ -438,11 +438,6 @@ if ( isset( $_GET['updated'] ) ) {
}
?>
<h2><?php _e( 'Menu Settings' ); ?></h2>
<table id="menu" class="form-table">
<tr>
<th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
<td>
<?php
$menu_perms = get_site_option( 'menu_items' );
/**
@ -462,6 +457,14 @@ if ( isset( $_GET['updated'] ) ) {
*/
$menu_items = apply_filters( 'mu_menu_items', array( 'plugins' => __( 'Plugins' ) ) );
if ( $menu_items ) :
?>
<h2><?php _e( 'Menu Settings' ); ?></h2>
<table id="menu" class="form-table">
<tr>
<th scope="row"><?php _e( 'Enable administration menus' ); ?></th>
<td>
<?php
echo '<fieldset><legend class="screen-reader-text">' . __( 'Enable menus' ) . '</legend>';
foreach ( (array) $menu_items as $key => $val ) {
@ -473,6 +476,9 @@ if ( isset( $_GET['updated'] ) ) {
</td>
</tr>
</table>
<?php
endif;
?>
<?php
/**

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.5-alpha-47615';
$wp_version = '5.5-alpha-47616';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.