wp/wp-includes/customize/class-wp-customize-nav-menu-location-control.php
changeset 9 177826044cd9
parent 7 cf61fcea0001
child 16 a86126ab1dd4
--- a/wp/wp-includes/customize/class-wp-customize-nav-menu-location-control.php	Mon Oct 14 18:06:33 2019 +0200
+++ b/wp/wp-includes/customize/class-wp-customize-nav-menu-location-control.php	Mon Oct 14 18:28:13 2019 +0200
@@ -56,6 +56,13 @@
 		if ( empty( $this->choices ) ) {
 			return;
 		}
+
+		$value_hidden_class = $no_value_hidden_class = '';
+		if ( $this->value() ) {
+			$value_hidden_class = ' hidden';
+		} else {
+			$no_value_hidden_class = ' hidden';
+		}
 		?>
 		<label>
 			<?php if ( ! empty( $this->label ) ) : ?>
@@ -74,8 +81,8 @@
 				?>
 			</select>
 		</label>
-		<button type="button" class="button-link create-menu<?php if ( $this->value() ) { echo ' hidden'; } ?>" data-location-id="<?php echo esc_attr( $this->location_id ); ?>" aria-label="<?php esc_attr_e( 'Create a menu for this location' ); ?>"><?php _e( '+ Create New Menu' ); ?></button>
-		<button type="button" class="button-link edit-menu<?php if ( ! $this->value() ) { echo ' hidden'; } ?>" aria-label="<?php esc_attr_e( 'Edit selected menu' ); ?>"><?php _e( 'Edit Menu' ); ?></button>
+		<button type="button" class="button-link create-menu<?php echo $value_hidden_class; ?>" data-location-id="<?php echo esc_attr( $this->location_id ); ?>" aria-label="<?php esc_attr_e( 'Create a menu for this location' ); ?>"><?php _e( '+ Create New Menu' ); ?></button>
+		<button type="button" class="button-link edit-menu<?php echo $no_value_hidden_class; ?>" aria-label="<?php esc_attr_e( 'Edit selected menu' ); ?>"><?php _e( 'Edit Menu' ); ?></button>
 		<?php
 	}
 }