WordPress.org

Make WordPress Core

Changeset 42217


Ignore:
Timestamp:
11/23/2017 04:08:42 AM (21 months ago)
Author:
pento
Message:

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.

Location:
trunk/src
Files:
20 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/edit-form-advanced.php

    r42201 r42217  
    628628
    629629if ( post_type_supports($post_type, 'editor') ) {
    630 ?>
    631 <div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
     630    $_wp_editor_expand_class = '';
     631    if ( $_wp_editor_expand ) {
     632        $_wp_editor_expand_class = ' wp-editor-expand';
     633    }
     634?>
     635<div id="postdivrich" class="postarea<?php echo $_wp_editor_expand_class; ?>">
    632636
    633637<?php wp_editor( $post->post_content, 'content', array(
  • trunk/src/wp-admin/edit-tag-form.php

    r41618 r42217  
    114114 */
    115115do_action( "{$taxonomy}_term_edit_form_top", $tag, $taxonomy );
     116
     117$tag_name_value = '';
     118if ( isset( $tag->name ) ) {
     119    $tag_name_value = esc_attr( $tag->name );
     120}
    116121?>
    117122    <table class="form-table">
    118123        <tr class="form-field form-required term-name-wrap">
    119124            <th scope="row"><label for="name"><?php _ex( 'Name', 'term name' ); ?></label></th>
    120             <td><input name="name" id="name" type="text" value="<?php if ( isset( $tag->name ) ) echo esc_attr($tag->name); ?>" size="40" aria-required="true" />
     125            <td><input name="name" id="name" type="text" value="<?php echo $tag_name_value; ?>" size="40" aria-required="true" />
    121126            <p class="description"><?php _e('The name is how it appears on your site.'); ?></p></td>
    122127        </tr>
  • trunk/src/wp-admin/includes/file.php

    r42112 r42217  
    17031703    }
    17041704    _e('If you do not remember your credentials, you should contact your web host.');
     1705
     1706    $password_value = '';
     1707    if ( defined('FTP_PASS') ) {
     1708        $password_value = '*****';
     1709    }
    17051710?></p>
    17061711<label for="hostname">
     
    17171722    <label for="password">
    17181723        <span class="field-title"><?php echo $label_pass; ?></span>
    1719         <input name="password" type="password" id="password" value="<?php if ( defined('FTP_PASS') ) echo '*****'; ?>"<?php disabled( defined('FTP_PASS') ); ?> />
     1724        <input name="password" type="password" id="password" value="<?php echo $password_value; ?>"<?php disabled( defined('FTP_PASS') ); ?> />
    17201725        <em><?php if ( ! defined('FTP_PASS') ) _e( 'This password will not be stored on the server.' ); ?></em>
    17211726    </label>
  • trunk/src/wp-admin/includes/media.php

    r41964 r42217  
    526526    do_action( "admin_head_{$content_func}" );
    527527}
     528
     529$body_id_attr = '';
     530if ( isset( $GLOBALS['body_id'] ) ) {
     531    $body_id_attr = ' id="' . $GLOBALS['body_id'] . '"';
     532}
    528533?>
    529534</head>
    530 <body<?php if ( isset($GLOBALS['body_id']) ) echo ' id="' . $GLOBALS['body_id'] . '"'; ?> class="wp-core-ui no-js">
     535<body<?php echo $body_id_attr; ?> class="wp-core-ui no-js">
    531536<script type="text/javascript">
    532537document.body.className = document.body.className.replace('no-js', 'js');
     
    27392744            $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>";
    27402745        }
     2746
     2747        $open_style = $not_open_style = '';
     2748        if ( $open ) {
     2749            $open_style = ' style="display:none"';
     2750        } else {
     2751            $not_open_style = ' style="display:none"';
     2752        }
    27412753    ?>
    27422754
    27432755        <div class="imgedit-response" id="imgedit-response-<?php echo $attachment_id; ?>"></div>
    27442756
    2745         <div<?php if ( $open ) echo ' style="display:none"'; ?> class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>">
     2757        <div<?php echo $open_style; ?> class="wp_attachment_image wp-clearfix" id="media-head-<?php echo $attachment_id; ?>">
    27462758            <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>
    27472759            <p><?php echo $image_edit_button; ?></p>
    27482760        </div>
    2749         <div<?php if ( ! $open ) echo ' style="display:none"'; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>">
     2761        <div<?php echo $not_open_style; ?> class="image-editor" id="image-editor-<?php echo $attachment_id; ?>">
    27502762            <?php if ( $open ) wp_image_editor( $attachment_id ); ?>
    27512763        </div>
  • trunk/src/wp-admin/includes/meta-boxes.php

    r42203 r42217  
    3838<div id="minor-publishing-actions">
    3939<div id="save-action">
    40 <?php if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) { ?>
    41 <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" />
     40<?php
     41    if ( 'publish' != $post->post_status && 'future' != $post->post_status && 'pending' != $post->post_status ) {
     42        $private_style = '';
     43        if ( 'private' == $post->post_status ) {
     44            $private_style = 'style="display:none"';
     45        }
     46?>
     47<input <?php echo $private_style; ?> type="submit" name="save" id="save-post" value="<?php esc_attr_e('Save Draft'); ?>" class="button" />
    4248<span class="spinner"></span>
    4349<?php } elseif ( 'pending' == $post->post_status && $can_publish ) { ?>
     
    104110?>
    105111</span>
    106 <?php if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) { ?>
    107 <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>
     112<?php
     113    if ( 'publish' == $post->post_status || 'private' == $post->post_status || $can_publish ) {
     114        $private_style = '';
     115        if ( 'private' == $post->post_status ) {
     116            $private_style = 'style="display:none"';
     117        }
     118?>
     119<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>
    108120
    109121<div id="post-status-select" class="hide-if-js">
  • trunk/src/wp-admin/includes/nav-menu.php

    r41987 r42217  
    391391    );
    392392
     393    $most_recent_url = $view_all_url = $search_url = '';
     394    if ( $nav_menu_selected_id ) {
     395        $most_recent_url = esc_url(add_query_arg($post_type_name . '-tab', 'most-recent', remove_query_arg($removed_args)));
     396        $view_all_url    = esc_url(add_query_arg($post_type_name . '-tab', 'all', remove_query_arg($removed_args)));
     397        $search_url      = esc_url(add_query_arg($post_type_name . '-tab', 'search', remove_query_arg($removed_args)));
     398    }
    393399    ?>
    394400    <div id="posttype-<?php echo $post_type_name; ?>" class="posttypediv">
    395401        <ul id="posttype-<?php echo $post_type_name; ?>-tabs" class="posttype-tabs add-menu-item-tabs">
    396402            <li <?php echo ( 'most-recent' == $current_tab ? ' class="tabs"' : '' ); ?>>
    397                 <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">
     403                <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">
    398404                    <?php _e( 'Most Recent' ); ?>
    399405                </a>
    400406            </li>
    401407            <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
    402                 <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">
     408                <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">
    403409                    <?php _e( 'View All' ); ?>
    404410                </a>
    405411            </li>
    406412            <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
    407                 <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">
     413                <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">
    408414                    <?php _e( 'Search'); ?>
    409415                </a>
     
    679685    );
    680686
     687    $most_used_url = $view_all_url = $search_url = '';
     688    if ( $nav_menu_selected_id ) {
     689        $most_used_url = esc_url(add_query_arg($taxonomy_name . '-tab', 'most-used', remove_query_arg($removed_args)));
     690        $view_all_url  = esc_url(add_query_arg($taxonomy_name . '-tab', 'all', remove_query_arg($removed_args)));
     691        $search_url    = esc_url(add_query_arg($taxonomy_name . '-tab', 'search', remove_query_arg($removed_args)));
     692    }
    681693    ?>
    682694    <div id="taxonomy-<?php echo $taxonomy_name; ?>" class="taxonomydiv">
    683695        <ul id="taxonomy-<?php echo $taxonomy_name; ?>-tabs" class="taxonomy-tabs add-menu-item-tabs">
    684696            <li <?php echo ( 'most-used' == $current_tab ? ' class="tabs"' : '' ); ?>>
    685                 <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">
     697                <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">
    686698                    <?php echo esc_html( $taxonomy->labels->most_used ); ?>
    687699                </a>
    688700            </li>
    689701            <li <?php echo ( 'all' == $current_tab ? ' class="tabs"' : '' ); ?>>
    690                 <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">
     702                <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">
    691703                    <?php _e( 'View All' ); ?>
    692704                </a>
    693705            </li>
    694706            <li <?php echo ( 'search' == $current_tab ? ' class="tabs"' : '' ); ?>>
    695                 <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; ?>">
     707                <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; ?>">
    696708                    <?php _e( 'Search' ); ?>
    697709                </a>
  • trunk/src/wp-admin/includes/widgets.php

    r41621 r42217  
    182182    $widget_number = isset($control['params'][0]['number']) ? $control['params'][0]['number'] : '';
    183183    $id_base = isset($control['id_base']) ? $control['id_base'] : $widget_id;
     184    $width = isset($control['width']) ? $control['width'] : '';
     185    $height = isset($control['height']) ? $control['height'] : '';
    184186    $multi_number = isset($sidebar_args['_multi_num']) ? $sidebar_args['_multi_num'] : '';
    185187    $add_new = isset($sidebar_args['_add']) ? $sidebar_args['_add'] : '';
     
    245247        echo "\t\t<p>" . __('There are no options for this widget.') . "</p>\n";
    246248    }
     249
     250    $noform_class = '';
     251    if ( 'noform' === $has_form ) {
     252        $noform_class = ' widget-control-noform';
     253    }
    247254    ?>
    248255    <?php echo $after_widget_content; ?>
    249256    <input type="hidden" name="widget-id" class="widget-id" value="<?php echo esc_attr($id_format); ?>" />
    250257    <input type="hidden" name="id_base" class="id_base" value="<?php echo esc_attr($id_base); ?>" />
    251     <input type="hidden" name="widget-width" class="widget-width" value="<?php if (isset( $control['width'] )) echo esc_attr($control['width']); ?>" />
    252     <input type="hidden" name="widget-height" class="widget-height" value="<?php if (isset( $control['height'] )) echo esc_attr($control['height']); ?>" />
     258    <input type="hidden" name="widget-width" class="widget-width" value="<?php echo esc_attr($width); ?>" />
     259    <input type="hidden" name="widget-height" class="widget-height" value="<?php echo esc_attr($height); ?>" />
    253260    <input type="hidden" name="widget_number" class="widget_number" value="<?php echo esc_attr($widget_number); ?>" />
    254261    <input type="hidden" name="multi_number" class="multi_number" value="<?php echo esc_attr($multi_number); ?>" />
     
    263270            </span>
    264271        </div>
    265         <div class="alignright<?php if ( 'noform' === $has_form ) echo ' widget-control-noform'; ?>">
     272        <div class="alignright<?php echo $noform_class; ?>">
    266273            <?php submit_button( __( 'Save' ), 'primary widget-control-save right', 'savewidget', false, array( 'id' => 'widget-' . esc_attr( $id_format ) . '-savewidget' ) ); ?>
    267274            <span class="spinner"></span>
  • trunk/src/wp-admin/nav-menus.php

    r41868 r42217  
    590590        );
    591591    endif;
     592
     593    $nav_tab_active_class = '';
     594    if ( ! isset( $_GET['action'] ) || isset( $_GET['action'] ) && 'locations' != $_GET['action'] ) {
     595        $nav_tab_active_class = ' nav-tab-active';
     596    }
    592597    ?>
    593598
     
    595600
    596601    <h2 class="nav-tab-wrapper wp-clearfix">
    597         <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>
     602        <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>
    598603        <?php if ( $num_locations && $menu_count ) : ?>
    599604            <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>
     
    631636                            <select name="menu-locations[<?php echo $_location; ?>]" id="locations-<?php echo $_location; ?>">
    632637                                <option value="0"><?php printf( '&mdash; %s &mdash;', esc_html__( 'Select a Menu' ) ); ?></option>
    633                                 <?php foreach ( $nav_menus as $menu ) : ?>
    634                                     <?php $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id; ?>
    635                                     <option <?php if ( $selected ) echo 'data-orig="true"'; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>">
     638                                <?php
     639                                    foreach ( $nav_menus as $menu ) :
     640                                        $data_orig = '';
     641                                        $selected = isset( $menu_locations[$_location] ) && $menu_locations[$_location] == $menu->term_id;
     642                                        if ( $selected ) {
     643                                            $data_orig = 'data-orig="true"';
     644                                        }
     645                                        ?>
     646                                    <option <?php echo $data_orig; ?> <?php selected( $selected ); ?> value="<?php echo $menu->term_id; ?>">
    636647                                        <?php echo wp_html_excerpt( $menu->name, 40, '&hellip;' ); ?>
    637648                                    </option>
     
    722733            </span><!-- /add-new-menu-action -->
    723734        </form>
    724     <?php endif; ?>
     735    <?php
     736        endif;
     737
     738        $metabox_holder_disabled_class = '';
     739        if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) {
     740            $metabox_holder_disabled_class = ' metabox-holder-disabled';
     741        }
     742    ?>
    725743    </div><!-- /manage-menus -->
    726744    <div id="nav-menus-frame" class="wp-clearfix">
    727     <div id="menu-settings-column" class="metabox-holder<?php if ( isset( $_GET['menu'] ) && '0' == $_GET['menu'] ) { echo ' metabox-holder-disabled'; } ?>">
     745    <div id="menu-settings-column" class="metabox-holder<?php echo $metabox_holder_disabled_class; ?>">
    728746
    729747        <div class="clear"></div>
     
    740758        <div id="menu-management">
    741759            <form id="update-nav-menu" method="post" enctype="multipart/form-data">
    742                 <div class="menu-edit <?php if ( $add_new_screen ) echo 'blank-slate'; ?>">
     760            <?php
     761                $new_screen_class = '';
     762                if ( $add_new_screen ) {
     763                    $new_screen_class = 'blank-slate';
     764                }
     765            ?>
     766                <div class="menu-edit <?php echo $new_screen_class; ?>">
    743767                    <input type="hidden" name="nav-menu-data">
    744768                    <?php
     
    771795                            <?php if ( ! $add_new_screen ) : ?>
    772796                            <h3><?php _e( 'Menu Structure' ); ?></h3>
    773                             <?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.' ); ?>
    774                             <div class="drag-instructions post-body-plain" <?php if ( isset( $menu_items ) && 0 == count( $menu_items ) ) { ?>style="display: none;"<?php } ?>>
     797                            <?php
     798                                $hide_style = '';
     799                                if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
     800                                    $hide_style = 'style="display: none;"';
     801                                }
     802                                $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.' );
     803                            ?>
     804                            <div class="drag-instructions post-body-plain" <?php echo $hide_style; ?>>
    775805                                <p><?php echo $starter_copy; ?></p>
    776806                            </div>
     
    788818                                    <input type="hidden" name="use-location" value="<?php echo esc_attr( $_GET['use-location'] ); ?>" />
    789819                                <?php endif; ?>
    790                             <?php endif; ?>
    791                             <div class="menu-settings" <?php if ( $one_theme_location_no_menus ) { ?>style="display: none;"<?php } ?>>
     820                            <?php
     821                                endif;
     822
     823                                $no_menus_style = '';
     824                                if ( $one_theme_location_no_menus ) {
     825                                    $no_menus_style = 'style="display: none;"';
     826                                }
     827                            ?>
     828                            <div class="menu-settings" <?php echo $no_menus_style; ?>>
    792829                                <h3><?php _e( 'Menu Settings' ); ?></h3>
    793830                                <?php
  • trunk/src/wp-admin/options-discussion.php

    r42201 r42217  
    184184
    185185$show_avatars = get_option( 'show_avatars' );
     186$show_avatars_class = '';
     187if ( ! $show_avatars ) {
     188    $show_avatars_class = ' hide-if-js';
     189}
    186190?>
    187191
     
    196200</fieldset></td>
    197201</tr>
    198 <tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
     202<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
    199203<th scope="row"><?php _e('Maximum Rating'); ?></th>
    200204<td><fieldset><legend class="screen-reader-text"><span><?php _e('Maximum Rating'); ?></span></legend>
     
    219223</fieldset></td>
    220224</tr>
    221 <tr class="avatar-settings<?php if ( ! $show_avatars ) echo ' hide-if-js'; ?>">
     225<tr class="avatar-settings<?php echo $show_avatars_class; ?>">
    222226<th scope="row"><?php _e('Default Avatar'); ?></th>
    223227<td class="defaultavatarpicker"><fieldset><legend class="screen-reader-text"><span><?php _e('Default Avatar'); ?></span></legend>
  • trunk/src/wp-admin/options-general.php

    r42201 r42217  
    6969</tr>
    7070
    71 <?php if ( !is_multisite() ) { ?>
     71<?php
     72    if ( !is_multisite() ) {
     73        $wp_site_url_class = $wp_home_class = '';
     74        if ( defined( 'WP_SITEURL' ) ) {
     75            $wp_site_url_class = ' disabled';
     76        }
     77        if ( defined( 'WP_HOME' ) ) {
     78            $wp_home_class = ' disabled';
     79        }
     80?>
    7281
    7382<tr>
    7483<th scope="row"><label for="siteurl"><?php _e('WordPress Address (URL)') ?></label></th>
    75 <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>
     84<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>
    7685</tr>
    7786
    7887<tr>
    7988<th scope="row"><label for="home"><?php _e('Site Address (URL)') ?></label></th>
    80 <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' ?>" />
     89<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; ?>" />
    8190<?php if ( ! defined( 'WP_HOME' ) ) : ?>
    8291<p class="description" id="home-description"><?php
  • trunk/src/wp-admin/setup-config.php

    r42201 r42217  
    9292    $body_classes = (array) $body_classes;
    9393    $body_classes[] = 'wp-core-ui';
     94    $dir_attr = '';
    9495    if ( is_rtl() ) {
    9596        $body_classes[] = 'rtl';
     97        $dir_attr = ' dir="rtl"';
    9698    }
    9799
     
    99101?>
    100102<!DOCTYPE html>
    101 <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
     103<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
    102104<head>
    103105    <meta name="viewport" content="width=device-width" />
  • trunk/src/wp-admin/themes.php

    r42201 r42217  
    251251    $aria_action = esc_attr( $theme['id'] . '-action' );
    252252    $aria_name   = esc_attr( $theme['id'] . '-name' );
     253
     254    $active_class = '';
     255    if ( $theme['active'] ) {
     256        $active_class = ' active';
     257    }
    253258    ?>
    254 <div class="theme<?php if ( $theme['active'] ) echo ' active'; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
     259<div class="theme<?php echo $active_class; ?>" tabindex="0" aria-describedby="<?php echo $aria_action . ' ' . $aria_name; ?>">
    255260    <?php if ( ! empty( $theme['screenshot'][0] ) ) { ?>
    256261        <div class="theme-screenshot">
  • trunk/src/wp-admin/user-edit.php

    r42201 r42217  
    245245    <tr class="user-rich-editing-wrap">
    246246        <th scope="row"><?php _e( 'Visual Editor' ); ?></th>
    247         <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>
     247        <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>
    248248    </tr>
    249249<?php endif; ?>
     
    264264        <th scope="row"><?php _e( 'Syntax Highlighting' ); ?></th>
    265265        <td>
    266             <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>
     266            <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>
    267267        </td>
    268268    </tr>
     
    291291<tr class="user-comment-shortcuts-wrap">
    292292<th scope="row"><?php _e( 'Keyboard Shortcuts' ); ?></th>
    293 <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>
     293<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>
    294294</tr>
    295295<?php endif; ?>
  • trunk/src/wp-content/themes/twentyeleven/header.php

    r31265 r42217  
    120120                // Has the text been hidden?
    121121                if ( 'blank' == get_header_textcolor() ) :
     122                    $header_image_class = '';
     123                    if ( $header_image ) {
     124                        $header_image_class = ' with-image';
     125                    }
    122126            ?>
    123                 <div class="only-search<?php if ( $header_image ) : ?> with-image<?php endif; ?>">
     127                <div class="only-search<?php echo $header_image_class; ?>">
    124128                <?php get_search_form(); ?>
    125129                </div>
  • trunk/src/wp-content/themes/twentyseventeen/functions.php

    r41756 r42217  
    399399    require_once( get_parent_theme_file_path( '/inc/color-patterns.php' ) );
    400400    $hue = absint( get_theme_mod( 'colorscheme_hue', 250 ) );
     401
     402    $customize_preview_data_hue = '';
     403    if ( is_customize_preview() ) {
     404        $customize_preview_data_hue = 'data-hue="' . $hue . '"';
     405    }
    401406?>
    402     <style type="text/css" id="custom-theme-colors" <?php if ( is_customize_preview() ) { echo 'data-hue="' . $hue . '"'; } ?>>
     407    <style type="text/css" id="custom-theme-colors" <?php echo $customize_preview_data_hue; ?>>
    403408        <?php echo twentyseventeen_custom_colors_css(); ?>
    404409    </style>
  • trunk/src/wp-includes/customize/class-wp-customize-nav-menu-location-control.php

    r41899 r42217  
    5757            return;
    5858        }
     59
     60        $value_hidden_class = $no_value_hidden_class = '';
     61        if ( $this->value() ) {
     62            $value_hidden_class = ' hidden';
     63        } else {
     64            $no_value_hidden_class = ' hidden';
     65        }
    5966        ?>
    6067        <label>
     
    7582            </select>
    7683        </label>
    77         <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>
    78         <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>
     84        <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>
     85        <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>
    7986        <?php
    8087    }
  • trunk/src/wp-includes/functions.php

    r42207 r42217  
    27562756        elseif ( function_exists( 'is_rtl' ) && is_rtl() )
    27572757            $text_direction = 'rtl';
     2758
     2759            if ( function_exists( 'language_attributes' ) && function_exists( 'is_rtl' ) ) {
     2760                $dir_attr = get_language_attributes();
     2761            } else {
     2762                $dir_attr = "dir='$text_direction'";
     2763            }
    27582764?>
    27592765<!DOCTYPE html>
    2760 <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'"; ?>>
     2766<html xmlns="http://www.w3.org/1999/xhtml" <?php echo $dir_attr; ?>>
    27612767<head>
    27622768    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
     
    37693775    nocache_headers();
    37703776    header( 'Content-Type: text/html; charset=utf-8' );
     3777
     3778    $dir_attr = '';
     3779    if ( is_rtl() ) {
     3780        $dir_attr = ' dir="rtl"';
     3781    }
    37713782?>
    37723783<!DOCTYPE html>
    3773 <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
     3784<html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
    37743785<head>
    37753786<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  • trunk/src/wp-includes/load.php

    r41922 r42217  
    212212    header( 'Content-Type: text/html; charset=utf-8' );
    213213    header( 'Retry-After: 600' );
     214
     215    $dir_attr = '';
     216    if ( is_rtl() ) {
     217        $dir_attr = ' dir="rtl"';
     218    }
    214219?>
    215220    <!DOCTYPE html>
    216     <html xmlns="http://www.w3.org/1999/xhtml"<?php if ( is_rtl() ) echo ' dir="rtl"'; ?>>
     221    <html xmlns="http://www.w3.org/1999/xhtml"<?php echo $dir_attr; ?>>
    217222    <head>
    218223    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  • trunk/src/wp-includes/widgets/class-wp-nav-menu-widget.php

    r41868 r42217  
    121121        $menus = wp_get_nav_menus();
    122122
     123        $empty_menus_style = $not_empty_menus_style = '';
     124        if ( empty( $menus ) ) {
     125            $empty_menus_style = ' style="display:none" ';
     126        } else {
     127            $not_empty_menus_style = ' style="display:none" ';
     128        }
     129
     130        $nav_menu_style = '';
     131        if ( ! $nav_menu ) {
     132            $nav_menu_style = 'display: none;';
     133        }
     134
    123135        // If no menus exists, direct the user to go and create some.
    124136        ?>
    125         <p class="nav-menu-widget-no-menus-message" <?php if ( ! empty( $menus ) ) { echo ' style="display:none" '; } ?>>
     137        <p class="nav-menu-widget-no-menus-message" <?php echo $not_empty_menus_style; ?>>
    126138            <?php
    127139            if ( $wp_customize instanceof WP_Customize_Manager ) {
     
    133145            <?php echo sprintf( __( 'No menus have been created yet. <a href="%s">Create some</a>.' ), esc_attr( $url ) ); ?>
    134146        </p>
    135         <div class="nav-menu-widget-form-controls" <?php if ( empty( $menus ) ) { echo ' style="display:none" '; } ?>>
     147        <div class="nav-menu-widget-form-controls" <?php echo $empty_menus_style; ?>>
    136148            <p>
    137149                <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title:' ) ?></label>
     
    150162            </p>
    151163            <?php if ( $wp_customize instanceof WP_Customize_Manager ) : ?>
    152                 <p class="edit-selected-nav-menu" style="<?php if ( ! $nav_menu ) { echo 'display: none;'; } ?>">
     164                <p class="edit-selected-nav-menu" style="<?php echo $nav_menu_style; ?>">
    153165                    <button type="button" class="button"><?php _e( 'Edit Menu' ) ?></button>
    154166                </p>
  • trunk/src/wp-signup.php

    r41911 r42217  
    167167            ?>
    168168        </p>
    169     <?php endif; // Languages. ?>
     169    <?php
     170        endif; // Languages.
     171
     172        $blog_public_on_checked = $blog_public_off_checked = '';
     173        if ( isset( $_POST['blog_public'] ) && '0' == $_POST['blog_public']  ) {
     174            $blog_public_off_checked = 'checked="checked"';
     175        } else {
     176            $blog_public_on_checked = 'checked="checked"';
     177        }
     178    ?>
    170179
    171180    <div id="privacy">
     
    175184            <br style="clear:both" />
    176185            <label class="checkbox" for="blog_public_on">
    177                 <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 } ?> />
     186                <input type="radio" id="blog_public_on" name="blog_public" value="1" <?php echo $blog_public_on_checked; ?> />
    178187                <strong><?php _e( 'Yes' ); ?></strong>
    179188            </label>
    180189            <label class="checkbox" for="blog_public_off">
    181                 <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 } ?> />
     190                <input type="radio" id="blog_public_off" name="blog_public" value="0" <?php echo $blog_public_off_checked; ?> />
    182191                <strong><?php _e( 'No' ); ?></strong>
    183192            </label>
Note: See TracChangeset for help on using the changeset viewer.