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:
Gary Pendergast 2017-11-23 04:09:49 +00:00
parent 850532fb01
commit a779284c00
21 changed files with 221 additions and 54 deletions

View File

@ -627,8 +627,12 @@ wp_nonce_field( 'samplepermalink', 'samplepermalinknonce', false );
do_action( 'edit_form_after_title', $post );
if ( post_type_supports($post_type, 'editor') ) {
$_wp_editor_expand_class = '';
if ( $_wp_editor_expand ) {
$_wp_editor_expand_class = ' wp-editor-expand';
}
?>
<div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
<div id="postdivrich" class="postarea<?php echo $_wp_editor_expand_class; ?>">
<?php wp_editor( $post->post_content, 'content', array(
'_content_editor_dfw' => $_content_editor_dfw,

View File

@ -113,11 +113,16 @@ wp_nonce_field( 'update-tag_' . $tag_ID );
* @param string $taxonomy Current $taxonomy slug.
*/
do_action( "{$taxonomy}_term_edit_form_top", $tag, $taxonomy );
$tag_name_value = '';
if ( isset( $tag->name ) ) {
$tag_name_value = esc_attr( $tag->name );
}
?>
<table class="form-table">
<tr class="form-field form-required term-name-wrap">
<th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th>
<td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />
<td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" />
<p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td>
</tr>
<?php if ( !global_terms_enabled() ) { ?>

View File

@ -1702,6 +1702,11 @@ echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connectio
echo ' ';
}
_e('If you do not remember your credentials, you should contact your web host.');
$password_value = '';
if ( defined('FTP_PASS') ) {
$password_value = '*****';
}
?></p>
<label for="hostname">
<span class="field-title"><?php _e( 'Hostname' ) ?></span>
@ -1716,7 +1721,7 @@ echo "<$heading_tag id='request-filesystem-credentials-title'>" . __( 'Connectio
<div class="ftp-password">
<label for="password">
<span class="field-title"><?php echo $label_pass; ?></span>
<input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php disabled( defined('FTP_PASS') ); ?> />
<input name="password" type="password" id="password" value="<?php echo $password_value; ?>"<?php disabled( defined('FTP_PASS') ); ?> />
<em><?php if ( ! defined('FTP_PASS') ) _e( 'This password will not be stored on the server.' ); ?></em>
</label>
</div>

View File

@ -525,9 +525,14 @@ if ( is_string( $content_func ) ) {
*/
do_action( "admin_head_{$content_func}" );
}
$body_id_attr = '';
if ( isset( $GLOBALS['body_id'] ) ) {
$body_id_attr = ' id="' . $GLOBALS['body_id'] . '"';
}
?>
</head>
<body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-core-ui no-js">
<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js">
<script type="text/javascript">
document.body.className = document.body.className.replace('no-js', 'js');
</script>
@ -2738,15 +2743,22 @@ function edit_form_image_editor( $post ) {
$nonce = wp_create_nonce( "image_editor-$post->ID" );
$image_edit_button = "<input type='button' id='imgedit-open-btn-$post->ID' onclick='imageEdit.open( $post->ID, \"$nonce\" )' class='button' value='" . esc_attr__( 'Edit Image' ) . "' /> <span class='spinner'></span>";
}
$open_style = $not_open_style = '';
if ( $open ) {
$open_style = ' style="display:none"';
} else {
$not_open_style = ' style="display:none"';
}
?>
<div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div>
<div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>">
<div<?php echo $open_style; ?> class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>">
<p id="thumbnail-head-<?php echo $attachment_id; ?>"><img class="thumbnail" src="<?php echo set_url_scheme( $thumb_url[0] ); ?>" style="max-width:100%" alt="" /></p>
<p><?php echo $image_edit_button; ?></p>
</div>
<div<?php if ( ! $open ) echo ' style="display:none"'; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>">
<div<?php echo $not_open_style; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>">
<?php if ( $open ) wp_image_editor( $attachment_id ); ?>
</div>
<?php

View File

@ -37,8 +37,14 @@ function post_submit_meta_box( $post, $args = array() ) {
<div id="minor-publishing-actions">
<div id="save-action">
<?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
<input <?php if ( 'private' == $post->post_status ) { ?>style="display:none"<?php } ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" />
<?php
if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) {
$private_style = '';
if ( 'private' == $post->post_status ) {
$private_style = 'style="display:none"';
}
?>
<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" />
<span class="spinner"></span>
<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
<input type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save as Pending'); ?>" class="button" />
@ -103,8 +109,14 @@ switch ( $post->post_status ) {
}
?>
</span>
<?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
<a href="#post_status" <?php if ( 'private' == $post->post_status ) { ?>style="display:none;" <?php } ?>class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
<?php
if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) {
$private_style = '';
if ( 'private' == $post->post_status ) {
$private_style = 'style="display:none"';
}
?>
<a href="#post_status" <?php echo $private_style; ?> class="edit-post-status hide-if-no-js" role="button"><span aria-hidden="true"><?php _e( 'Edit' ); ?></span> <span class="screen-reader-text"><?php _e( 'Edit status' ); ?></span></a>
<div id="post-status-select" class="hide-if-js">
<input type="hidden" name="hidden_post_status" id="hidden_post_status" value="<?php echo esc_attr( ('auto-draft' == $post->post_status ) ? 'draft' : $post->post_status); ?>" />

View File

@ -390,21 +390,27 @@ function wp_nav_menu_item_post_type_meta_box( $object, $box ) {
'_wpnonce',
);
$most_recent_url = $view_all_url = $search_url = '';
if ( $nav_menu_selected_id ) {
$most_recent_url = esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args)));
$view_all_url = esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args)));
$search_url = esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)));
}
?>
<div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
<ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
<li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
<a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-most-recent" href="<?php echo $most_recent_url; ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-most-recent">
<?php _e( 'Most Recent' ); ?>
</a>
</li>
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#<?php echo $post_type_name; ?>-all">
<a class="nav-tab-link" data-type="<?php echo esc_attr( $post_type_name ); ?>-all" href="<?php echo $view_all_url; ?>#<?php echo $post_type_name; ?>-all">
<?php _e( 'View All' ); ?>
</a>
</li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
<a class="nav-tab-link" data-type="tabs-panel-posttype-<?php echo esc_attr( $post_type_name ); ?>-search" href="<?php echo $search_url; ?>#tabs-panel-posttype-<?php echo $post_type_name; ?>-search">
<?php _e( 'Search'); ?>
</a>
</li>
@ -678,21 +684,27 @@ function wp_nav_menu_item_taxonomy_meta_box( $object, $box ) {
'_wpnonce',
);
$most_used_url = $view_all_url = $search_url = '';
if ( $nav_menu_selected_id ) {
$most_used_url = esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args)));
$view_all_url = esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args)));
$search_url = esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args)));
}
?>
<div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
<ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
<li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
<a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-pop" href="<?php echo $most_used_url; ?>#tabs-panel-<?php echo $taxonomy_name; ?>-pop">
<?php echo esc_html( $taxonomy->labels->most_used ); ?>
</a>
</li>
<li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args))); ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all">
<a class="nav-tab-link" data-type="tabs-panel-<?php echo esc_attr( $taxonomy_name ); ?>-all" href="<?php echo $view_all_url; ?>#tabs-panel-<?php echo $taxonomy_name; ?>-all">
<?php _e( 'View All' ); ?>
</a>
</li>
<li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
<a class="nav-tab-link" data-type="tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>" href="<?php if ( $nav_menu_selected_id ) echo esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args))); ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
<a class="nav-tab-link" data-type="tabs-panel-search-taxonomy-<?php echo esc_attr( $taxonomy_name ); ?>" href="<?php echo $search_url; ?>#tabs-panel-search-taxonomy-<?php echo $taxonomy_name; ?>">
<?php _e( 'Search' ); ?>
</a>
</li>

View File

@ -181,6 +181,8 @@ function wp_widget_control( $sidebar_args ) {
$id_format = $widget['id'];
$widget_number = isset($control['params'][0]['number']) ? $control['params'][0]['number'] : '';
$id_base = isset($control['id_base']) ? $control['id_base'] : $widget_id;
$width = isset($control['width']) ? $control['width'] : '';
$height = isset($control['height']) ? $control['height'] : '';
$multi_number = isset($sidebar_args['_multi_num']) ? $sidebar_args['_multi_num'] : '';
$add_new = isset($sidebar_args['_add']) ? $sidebar_args['_add'] : '';
@ -244,12 +246,17 @@ function wp_widget_control( $sidebar_args ) {
} else {
echo "\t\t<p>" . __('There are no options for this widget.') . "</p>\n";
}
$noform_class = '';
if ( 'noform' === $has_form ) {
$noform_class = ' widget-control-noform';
}
?>
<?php echo $after_widget_content; ?>
<input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($id_format); ?>" />
<input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
<input type="hidden" name="widget-width" class="widget-width" value="<?php if (isset( $control['width'] )) echo esc_attr($control['width']); ?>" />
<input type="hidden" name="widget-height" class="widget-height" value="<?php if (isset( $control['height'] )) echo esc_attr($control['height']); ?>" />
<input type="hidden" name="widget-width" class="widget-width" value="<?php echo esc_attr($width); ?>" />
<input type="hidden" name="widget-height" class="widget-height" value="<?php echo esc_attr($height); ?>" />
<input type="hidden" name="widget_number" class="widget_number" value="<?php echo esc_attr($widget_number); ?>" />
<input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" />
<input type="hidden" name="add_new" class="add_new" value="<?php echo esc_attr($add_new); ?>" />
@ -262,7 +269,7 @@ function wp_widget_control( $sidebar_args ) {
<button type="button" class="button-link widget-control-close"><?php _e( 'Done' ); ?></button>
</span>
</div>
<div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
<div class="alignright<?php echo $noform_class; ?>">
<?php submit_button( __( 'Save' ), 'primary widget-control-save right', 'savewidget', false, array( 'id' => 'widget-' . esc_attr( $id_format ) . '-savewidget' ) ); ?>
<span class="spinner"></span>
</div>

View File

@ -589,12 +589,17 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
__( 'Manage with Live Preview' )
);
endif;
$nav_tab_active_class = '';
if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) {
$nav_tab_active_class = ' nav-tab-active';
}
?>
<hr class="wp-header-end">
<h2 class="nav-tab-wrapper wp-clearfix">
<a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a>
<a href="<?php echo admin_url( 'nav-menus.php' ); ?>" class="nav-tab<?php echo $nav_tab_active_class; ?>"><?php esc_html_e( 'Edit Menus' ); ?></a>
<?php if ( $num_locations && $menu_count ) : ?>
<a href="<?php echo esc_url( add_query_arg( array( 'action' => 'locations' ), admin_url( 'nav-menus.php' ) ) ); ?>" class="nav-tab<?php if ( $locations_screen ) echo ' nav-tab-active'; ?>"><?php esc_html_e( 'Manage Locations' ); ?></a>
<?php
@ -630,9 +635,15 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<td class="menu-location-menus">
<select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>">
<option value="0"><?php printf( '&mdash; %s &mdash;', esc_html__( 'Select a Menu' ) ); ?></option>
<?php foreach ( $nav_menus as $menu ) : ?>
<?php $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id; ?>
<option <?php if ( $selected ) echo 'data-orig="true"'; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>">
<?php
foreach ( $nav_menus as $menu ) :
$data_orig = '';
$selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id;
if ( $selected ) {
$data_orig = 'data-orig="true"';
}
?>
<option <?php echo $data_orig; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>">
<?php echo wp_html_excerpt( $menu->name, 40, '&hellip;' ); ?>
</option>
<?php endforeach; ?>
@ -721,10 +732,17 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<?php printf( __( 'or <a href="%s">create a new menu</a>.' ), esc_url( add_query_arg( array( 'action' => 'edit', 'menu' => 0 ), admin_url( 'nav-menus.php' ) ) ) ); ?>
</span><!-- /add-new-menu-action -->
</form>
<?php endif; ?>
<?php
endif;
$metabox_holder_disabled_class = '';
if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
$metabox_holder_disabled_class = ' metabox-holder-disabled';
}
?>
</div><!-- /manage-menus -->
<div id="nav-menus-frame" class="wp-clearfix">
<div id="menu-settings-column" class="metabox-holder<?php if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) { echo ' metabox-holder-disabled'; } ?>">
<div id="menu-settings-column" class="metabox-holder<?php echo $metabox_holder_disabled_class; ?>">
<div class="clear"></div>
@ -739,7 +757,13 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<div id="menu-management-liquid">
<div id="menu-management">
<form id="update-nav-menu" method="post" enctype="multipart/form-data">
<div class="menu-edit <?php if ( $add_new_screen ) echo 'blank-slate'; ?>">
<?php
$new_screen_class = '';
if ( $add_new_screen ) {
$new_screen_class = 'blank-slate';
}
?>
<div class="menu-edit <?php echo $new_screen_class; ?>">
<input type="hidden" name="nav-menu-data">
<?php
wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
@ -770,8 +794,14 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<div id="post-body-content" class="wp-clearfix">
<?php if ( ! $add_new_screen ) : ?>
<h3><?php _e( 'Menu Structure' ); ?></h3>
<?php $starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' ); ?>
<div class="drag-instructions post-body-plain" <?php if ( isset( $menu_items ) && 0 == count( $menu_items ) ) { ?>style="display: none;"<?php } ?>>
<?php
$hide_style = '';
if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
$hide_style = 'style="display: none;"';
}
$starter_copy = ( $one_theme_location_no_menus ) ? __( 'Edit your default menu by adding or removing items. Drag each item into the order you prefer. Click Create Menu to save your changes.' ) : __( 'Drag each item into the order you prefer. Click the arrow on the right of the item to reveal additional configuration options.' );
?>
<div class="drag-instructions post-body-plain" <?php echo $hide_style; ?>>
<p><?php echo $starter_copy; ?></p>
</div>
<?php
@ -787,8 +817,15 @@ require_once( ABSPATH . 'wp-admin/admin-header.php' );
<?php if ( isset( $_GET['use-location'] ) ) : ?>
<input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
<?php endif; ?>
<?php endif; ?>
<div class="menu-settings" <?php if ( $one_theme_location_no_menus ) { ?>style="display: none;"<?php } ?>>
<?php
endif;
$no_menus_style = '';
if ( $one_theme_location_no_menus ) {
$no_menus_style = 'style="display: none;"';
}
?>
<div class="menu-settings" <?php echo $no_menus_style; ?>>
<h3><?php _e( 'Menu Settings' ); ?></h3>
<?php
if ( ! isset( $auto_add ) ) {

View File

@ -183,6 +183,10 @@ printf( __('Comments should be displayed with the %s comments at the top of each
// the above would be a good place to link to codex documentation on the gravatar functions, for putting it in themes. anything like that?
$show_avatars = get_option( 'show_avatars' );
$show_avatars_class = '';
if ( ! $show_avatars ) {
$show_avatars_class = ' hide-if-js';
}
?>
<table class="form-table">
@ -195,7 +199,7 @@ $show_avatars = get_option( 'show_avatars' );
</label>
</fieldset></td>
</tr>
<tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
<th scope="row"><?php _e('Maximum Rating'); ?></th>
<td><fieldset><legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend>
@ -218,7 +222,7 @@ endforeach;
</fieldset></td>
</tr>
<tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
<th scope="row"><?php _e('Default Avatar'); ?></th>
<td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend>

View File

@ -68,16 +68,25 @@ include( ABSPATH . 'wp-admin/admin-header.php' );
<p class="description" id="tagline-description"><?php _e( 'In a few words, explain what this site is about.' ) ?></p></td>
</tr>
<?php if ( !is_multisite() ) { ?>
<?php
if ( !is_multisite() ) {
$wp_site_url_class = $wp_home_class = '';
if ( defined( 'WP_SITEURL' ) ) {
$wp_site_url_class = ' disabled';
}
if ( defined( 'WP_HOME' ) ) {
$wp_home_class = ' disabled';
}
?>
<tr>
<th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php if ( defined( 'WP_SITEURL' ) ) echo ' disabled' ?>" /></td>
<td><input name="siteurl" type="url" id="siteurl" value="<?php form_option( 'siteurl' ); ?>"<?php disabled( defined( 'WP_SITEURL' ) ); ?> class="regular-text code<?php echo $wp_site_url_class; ?>" /></td>
</tr>
<tr>
<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php if ( defined( 'WP_HOME' ) ) echo ' disabled' ?>" />
<td><input name="home" type="url" id="home" aria-describedby="home-description" value="<?php form_option( 'home' ); ?>"<?php disabled( defined( 'WP_HOME' ) ); ?> class="regular-text code<?php echo $wp_home_class; ?>" />
<?php if ( ! defined( 'WP_HOME' ) ) : ?>
<p class="description" id="home-description"><?php
printf(

View File

@ -91,14 +91,16 @@ $step = isset( $_GET['step'] ) ? (int) $_GET['step'] : -1;
function setup_config_display_header( $body_classes = array() ) {
$body_classes = (array) $body_classes;
$body_classes[] = 'wp-core-ui';
$dir_attr = '';
if ( is_rtl() ) {
$body_classes[] = 'rtl';
$dir_attr = ' dir="rtl"';
}
header( 'Content-Type: text/html; charset=utf-8' );
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

View File

@ -250,8 +250,13 @@ if ( ! empty( $_GET['search'] ) ) {
foreach ( $themes as $theme ) :
$aria_action = esc_attr( $theme['id'] . '-action' );
$aria_name = esc_attr( $theme['id'] . '-name' );
$active_class = '';
if ( $theme['active'] ) {
$active_class = ' active';
}
?>
<div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
<div class="theme<?php echo $active_class; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
<?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
<div class="theme-screenshot">
<img src="<?php echo $theme['screenshot'][0]; ?>" alt="" />

View File

@ -244,7 +244,7 @@ if ( ! IS_PROFILE_PAGE ) {
<?php if ( ! ( IS_PROFILE_PAGE && ! $user_can_edit ) ) : ?>
<tr class="user-rich-editing-wrap">
<th scope="row"><?php _e( 'Visual Editor' ); ?></th>
<td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php if ( ! empty( $profileuser->rich_editing ) ) checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td>
<td><label for="rich_editing"><input name="rich_editing" type="checkbox" id="rich_editing" value="false" <?php checked( 'false', $profileuser->rich_editing ); ?> /> <?php _e( 'Disable the visual editor when writing' ); ?></label></td>
</tr>
<?php endif; ?>
<?php
@ -263,7 +263,7 @@ $show_syntax_highlighting_preference = (
<tr class="user-syntax-highlighting-wrap">
<th scope="row"><?php _e( 'Syntax Highlighting' ); ?></th>
<td>
<label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php if ( ! empty( $profileuser->syntax_highlighting ) ) checked( 'false', $profileuser->syntax_highlighting ); ?> /> <?php _e( 'Disable syntax highlighting when editing code' ); ?></label>
<label for="syntax_highlighting"><input name="syntax_highlighting" type="checkbox" id="syntax_highlighting" value="false" <?php checked( 'false', $profileuser->syntax_highlighting ); ?> /> <?php _e( 'Disable syntax highlighting when editing code' ); ?></label>
</td>
</tr>
<?php endif; ?>
@ -290,7 +290,7 @@ endif; // $_wp_admin_css_colors
if ( !( IS_PROFILE_PAGE && !$user_can_edit ) ) : ?>
<tr class="user-comment-shortcuts-wrap">
<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php if ( ! empty( $profileuser->comment_shortcuts ) ) checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>'); ?></td>
<td><label for="comment_shortcuts"><input type="checkbox" name="comment_shortcuts" id="comment_shortcuts" value="true" <?php checked( 'true', $profileuser->comment_shortcuts ); ?> /> <?php _e('Enable keyboard shortcuts for comment moderation.'); ?></label> <?php _e('<a href="https://codex.wordpress.org/Keyboard_Shortcuts" target="_blank">More information</a>'); ?></td>
</tr>
<?php endif; ?>
<tr class="show-admin-bar user-admin-bar-front-wrap">

View File

@ -119,8 +119,12 @@
<?php
// Has the text been hidden?
if ( 'blank' == get_header_textcolor() ) :
$header_image_class = '';
if ( $header_image ) {
$header_image_class = ' with-image';
}
?>
<div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
<div class="only-search<?php echo $header_image_class; ?>">
<?php get_search_form(); ?>
</div>
<?php

View File

@ -398,8 +398,13 @@ function twentyseventeen_colors_css_wrap() {
require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) );
$hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );
$customize_preview_data_hue = '';
if ( is_customize_preview() ) {
$customize_preview_data_hue = 'data-hue="' . $hue . '"';
}
?>
<style type="text/css" id="custom-theme-colors" <?php if ( is_customize_preview() ) { echo 'data-hue="' . $hue . '"'; } ?>>
<style type="text/css" id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>>
<?php echo twentyseventeen_custom_colors_css(); ?>
</style>
<?php }

View File

@ -56,6 +56,13 @@ class WP_Customize_Nav_Menu_Location_Control extends WP_Customize_Control {
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 @@ class WP_Customize_Nav_Menu_Location_Control extends WP_Customize_Control {
?>
</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
}
}

View File

@ -2755,9 +2755,15 @@ function _default_wp_die_handler( $message, $title = '', $args = array() ) {
$text_direction = 'rtl';
elseif ( function_exists( 'is_rtl' ) && is_rtl() )
$text_direction = 'rtl';
if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) {
$dir_attr = get_language_attributes();
} else {
$dir_attr = "dir='$text_direction'";
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" <?php if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) language_attributes(); else echo "dir='$text_direction'"; ?>>
<html xmlns="http://www.w3.org/1999/xhtml" <?php echo $dir_attr; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width">
@ -3768,9 +3774,14 @@ function dead_db() {
status_header( 500 );
nocache_headers();
header( 'Content-Type: text/html; charset=utf-8' );
$dir_attr = '';
if ( is_rtl() ) {
$dir_attr = ' dir="rtl"';
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e( 'Database Error' ); ?></title>

View File

@ -211,9 +211,14 @@ function wp_maintenance() {
header( "$protocol 503 Service Unavailable", true, 503 );
header( 'Content-Type: text/html; charset=utf-8' );
header( 'Retry-After: 600' );
$dir_attr = '';
if ( is_rtl() ) {
$dir_attr = ' dir="rtl"';
}
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title><?php _e( 'Maintenance' ); ?></title>

View File

@ -4,7 +4,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.0-alpha-42216';
$wp_version = '5.0-alpha-42217';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -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; ?>

View File

@ -166,7 +166,16 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
) );
?>
</p>
<?php endif; // Languages. ?>
<?php
endif; // Languages.
$blog_public_on_checked = $blog_public_off_checked = '';
if ( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public'] ) {
$blog_public_off_checked = 'checked="checked"';
} else {
$blog_public_on_checked = 'checked="checked"';
}
?>
<div id="privacy">
<p class="privacy-intro">
@ -174,11 +183,11 @@ function show_blog_form( $blogname = '', $blog_title = '', $errors = '' ) {
<?php _e( 'Allow search engines to index this site.' ); ?>
<br style="clear:both" />
<label class="checkbox" for="blog_public_on">
<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php if ( !isset( $_POST['blog_public'] ) || $_POST['blog_public'] == '1' ) { ?>checked="checked"<?php } ?> />
<input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> />
<strong><?php _e( 'Yes' ); ?></strong>
</label>
<label class="checkbox" for="blog_public_off">
<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php if ( isset( $_POST['blog_public'] ) && $_POST['blog_public'] == '0' ) { ?>checked="checked"<?php } ?> />
<input type="radio" id="blog_public_off" name="blog_public" value="0" <?php echo $blog_public_off_checked; ?> />
<strong><?php _e( 'No' ); ?></strong>
</label>
</p>