Make WordPress Core

Ticket #41057: 41057.3.diff

File 41057.3.diff, 10.0 KB (added by pento, 7 years ago)
  • src/wp-admin/edit-form-advanced.php

     
    627627do_action( 'edit_form_after_title', $post );
    628628
    629629if ( post_type_supports($post_type, 'editor') ) {
     630        $_wp_editor_expand_class = '';
     631        if ( $_wp_editor_expand ) {
     632                $_wp_editor_expand_class = ' wp-editor-expand';
     633        }
    630634?>
    631 <div id="postdivrich" class="postarea<?php if ( $_wp_editor_expand ) { echo ' wp-editor-expand'; } ?>">
     635<div id="postdivrich" class="postarea<?php echo $_wp_editor_expand_class; ?>">
    632636
    633637<?php wp_editor( $post->post_content, 'content', array(
    634638        '_content_editor_dfw' => $_content_editor_dfw,
  • src/wp-admin/includes/widgets.php

     
    181181        $id_format = $widget['id'];
    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'] : '';
    186188
     
    244246        } else {
    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); ?>" />
    255262        <input type="hidden" name="add_new" class="add_new" value="<?php echo esc_attr($add_new); ?>" />
     
    262269                                <button type="button" class="button-link widget-control-close"><?php _e( 'Done' ); ?></button>
    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>
    268275                </div>
  • src/wp-admin/nav-menus.php

     
    589589                        __( 'Manage with Live Preview' )
    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
    594599        <hr class="wp-header-end">
    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>
    600605                <?php
     
    630635                                                <td class="menu-location-menus">
    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>
    638649                                                                <?php endforeach; ?>
     
    739750        <div id="menu-management-liquid">
    740751                <div id="menu-management">
    741752                        <form id="update-nav-menu" method="post" enctype="multipart/form-data">
    742                                 <div class="menu-edit <?php if ( $add_new_screen ) echo 'blank-slate'; ?>">
     753                        <?php
     754                                $new_screen_class = '';
     755                                if ( $add_new_screen ) {
     756                                        $new_screen_class = 'blank-slate';
     757                                }
     758                        ?>
     759                                <div class="menu-edit <?php echo $new_screen_class; ?>">
    743760                                        <input type="hidden" name="nav-menu-data">
    744761                                        <?php
    745762                                        wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', false );
     
    770787                                                <div id="post-body-content" class="wp-clearfix">
    771788                                                        <?php if ( ! $add_new_screen ) : ?>
    772789                                                        <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 } ?>>
     790                                                        <?php
     791                                                                $hide_style = '';
     792                                                                if ( isset( $menu_items ) && 0 == count( $menu_items ) ) {
     793                                                                        $hide_style = 'style="display: none;"';
     794                                                                }
     795                                                                $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.' );
     796                                                        ?>
     797                                                        <div class="drag-instructions post-body-plain" <?php echo $hide_style; ?>>
    775798                                                                <p><?php echo $starter_copy; ?></p>
    776799                                                        </div>
    777800                                                        <?php
  • src/wp-admin/options-general.php

     
    6868<p class="description" id="tagline-description"><?php _e( 'In a few words, explain what this site is about.' ) ?></p></td>
    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
    8392        printf(
  • src/wp-admin/themes.php

     
    250250foreach ( $themes as $theme ) :
    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">
    257262                        <img src="<?php echo $theme['screenshot'][0]; ?>" alt="" />