X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/16e7b37c7914d753890c1a05a9335f3b43751eb8..refs/tags/wordpress-4.7.1:/wp-includes/class-wp-customize-manager.php diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 127d572b..f80708a2 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -798,7 +798,8 @@ final class WP_Customize_Manager { 'no_found_rows' => true, 'cache_results' => true, 'update_post_meta_cache' => false, - 'update_term_meta_cache' => false, + 'update_post_term_cache' => false, + 'lazy_load_term_meta' => false, ) ); if ( ! empty( $changeset_post_query->posts ) ) { // Note: 'fields'=>'ids' is not being used in order to cache the post object as it will be needed. @@ -1776,6 +1777,17 @@ final class WP_Customize_Manager { } $allowed_hosts[] = $host; } + + $switched_locale = switch_to_locale( get_user_locale() ); + $l10n = array( + 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ), + 'linkUnpreviewable' => __( 'This link is not live-previewable.' ), + 'formUnpreviewable' => __( 'This form is not live-previewable.' ), + ); + if ( $switched_locale ) { + restore_previous_locale(); + } + $settings = array( 'changeset' => array( 'uuid' => $this->_changeset_uuid, @@ -1800,11 +1812,7 @@ final class WP_Customize_Manager { 'activeControls' => array(), 'settingValidities' => $exported_setting_validities, 'nonce' => current_user_can( 'customize' ) ? $this->get_nonces() : array(), - 'l10n' => array( - 'shiftClickToEdit' => __( 'Shift-click to edit this element.' ), - 'linkUnpreviewable' => __( 'This link is not live-previewable.' ), - 'formUnpreviewable' => __( 'This form is not live-previewable.' ), - ), + 'l10n' => $l10n, '_dirty' => array_keys( $post_values ), ); @@ -3889,7 +3897,7 @@ final class WP_Customize_Manager { $this->add_setting( 'external_header_video', array( 'theme_supports' => array( 'custom-header', 'video' ), 'transport' => 'postMessage', - 'sanitize_callback' => 'esc_url_raw', + 'sanitize_callback' => array( $this, '_sanitize_external_header_video' ), 'validate_callback' => array( $this, '_validate_external_header_video' ), ) ); @@ -4311,6 +4319,18 @@ final class WP_Customize_Manager { return $validity; } + /** + * Callback for sanitizing the external_header_video value. + * + * @since 4.7.1 + * + * @param string $value URL. + * @return string Sanitized URL. + */ + public function _sanitize_external_header_video( $value ) { + return esc_url_raw( trim( $value ) ); + } + /** * Callback for rendering the custom logo, used in the custom_logo partial. *