General: Reformat inline if () statements inside HTML tags.
This pattern occurs a handful of times across the codebase:
`<div class="foo<?php if ( $bar ) { echo ' baz'; } ?>">`
Unfortunately, it doesn't really play nicely with `phpcbf`, so all instances need to be removed in preperation for auto code formatting.
See #41057.
Built from https://develop.svn.wordpress.org/trunk@42217
git-svn-id: http://core.svn.wordpress.org/trunk@42046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -120,9 +120,21 @@ class WP_Nav_Menu_Widget extends WP_Widget {
|
||||
// Get menus
|
||||
$menus = wp_get_nav_menus();
|
||||
|
||||
$empty_menus_style = $not_empty_menus_style = '';
|
||||
if ( empty( $menus ) ) {
|
||||
$empty_menus_style = ' style="display:none" ';
|
||||
} else {
|
||||
$not_empty_menus_style = ' style="display:none" ';
|
||||
}
|
||||
|
||||
$nav_menu_style = '';
|
||||
if ( ! $nav_menu ) {
|
||||
$nav_menu_style = 'display: none;';
|
||||
}
|
||||
|
||||
// If no menus exists, direct the user to go and create some.
|
||||
?>
|
||||
<p class="nav-menu-widget-no-menus-message" <?php if ( ! empty( $menus ) ) { echo ' style="display:none" '; } ?>>
|
||||
<p class="nav-menu-widget-no-menus-message" <?php echo $not_empty_menus_style; ?>>
|
||||
<?php
|
||||
if ( $wp_customize instanceof WP_Customize_Manager ) {
|
||||
$url = 'javascript: wp.customize.panel( "nav_menus" ).focus();';
|
||||
@@ -132,7 +144,7 @@ class WP_Nav_Menu_Widget extends WP_Widget {
|
||||
?>
|
||||
<?php echo sprintf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) ); ?>
|
||||
</p>
|
||||
<div class="nav-menu-widget-form-controls" <?php if ( empty( $menus ) ) { echo ' style="display:none" '; } ?>>
|
||||
<div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>>
|
||||
<p>
|
||||
<label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ) ?></label>
|
||||
<input type="text" class="widefat" id="<?php echo $this->get_field_id( 'title' ); ?>" name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo esc_attr( $title ); ?>"/>
|
||||
@@ -149,7 +161,7 @@ class WP_Nav_Menu_Widget extends WP_Widget {
|
||||
</select>
|
||||
</p>
|
||||
<?php if ( $wp_customize instanceof WP_Customize_Manager ) : ?>
|
||||
<p class="edit-selected-nav-menu" style="<?php if ( ! $nav_menu ) { echo 'display: none;'; } ?>">
|
||||
<p class="edit-selected-nav-menu" style="<?php echo $nav_menu_style; ?>">
|
||||
<button type="button" class="button"><?php _e( 'Edit Menu' ) ?></button>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
Reference in New Issue
Block a user