Make WordPress Core


Ignore:
Timestamp:
10/02/2017 04:11:50 AM (6 years ago)
Author:
westonruter
Message:

Customize: Fix WP_Customize_Date_Time_Control to be re-usable for plugins and custom settings.

  • Allow time fields to be omitted by constructing with timeIncluded as false.
  • Ensure reportValidity is only called on a control when it is in an expanded section.
  • Rename "ampm" to "meridian".
  • Improve accessibility and fix HTML validation and style issues for both the date/time control and the preview link control.
  • Fix styling of dropdowns and clean CSS.
  • Improve accessibility of nav menus component.

Props westonruter, afercia, sayedwp, melchoyce.
Amends [41626].
See #39896.
Fixes #42022.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r41667 r41670  
    36233623        </script>
    36243624        <script type="text/html" id="tmpl-customize-preview-link-control" >
    3625             <span class="customize-control-title">
    3626                 <label><?php esc_html_e( 'Share Preview Link' ); ?></label>
    3627             </span>
    3628             <span class="description customize-control-description"><?php esc_html_e( 'See how changes would look live on your website, and share the preview with people who can\'t access the Customizer.' ); ?></span>
     3625            <# var elementPrefix = _.uniqueId( 'el' ) + '-' #>
     3626            <p class="customize-control-title">
     3627                <?php esc_html_e( 'Share Preview Link' ); ?>
     3628            </p>
     3629            <p class="description customize-control-description"><?php esc_html_e( 'See how changes would look live on your website, and share the preview with people who can\'t access the Customizer.' ); ?></p>
    36293630            <div class="customize-control-notifications-container"></div>
    36303631            <div class="preview-link-wrapper">
    3631                 <label>
    3632                     <span class="screen-reader-text"><?php esc_html_e( 'Preview Link' ); ?></span>
    3633                     <a class="preview-control-element" data-component="link" href="" target=""></a>
    3634                     <input readonly class="preview-control-element" data-component="input" value="test" >
    3635                     <button class="customize-copy-preview-link preview-control-element button button-secondary" data-component="button" data-copy-text="<?php esc_attr_e( 'Copy' ); ?>" data-copied-text="<?php esc_attr_e( 'Copied' ); ?>" ><?php esc_html_e( 'Copy' ); ?></button>
    3636                 </label>
     3632                <label for="{{ elementPrefix }}customize-preview-link-input" class="screen-reader-text"><?php esc_html_e( 'Preview Link' ); ?></label>
     3633                <a href="" target="">
     3634                    <span class="preview-control-element" data-component="url"></span>
     3635                    <span class="screen-reader-text"><?php _e( '(opens in a new window)' ); ?></span>
     3636                </a>
     3637                <input id="{{ elementPrefix }}customize-preview-link-input" readonly class="preview-control-element" data-component="input">
     3638                <button class="customize-copy-preview-link preview-control-element button button-secondary" data-component="button" data-copy-text="<?php esc_attr_e( 'Copy' ); ?>" data-copied-text="<?php esc_attr_e( 'Copied' ); ?>" ><?php esc_html_e( 'Copy' ); ?></button>
    36373639            </div>
    36383640        </script>
     
    42374239            $initial_date = current_time( 'mysql', false );
    42384240        }
     4241
    42394242        $this->add_control( new WP_Customize_Date_Time_Control( $this, 'changeset_scheduled_date', array(
    42404243            'section' => 'publish_settings',
     
    42444247            'min_year' => date( 'Y' ),
    42454248            'allow_past_date' => false,
     4249            'include_time' => true,
    42464250            'twelve_hour_format' => false !== stripos( get_option( 'time_format' ), 'a' ),
    42474251            'description' => __( 'Schedule your customization changes to publish ("go live") at a future date.' ),
Note: See TracChangeset for help on using the changeset viewer.