'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.
}
$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,
'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 ),
);
$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' ),
) );
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.
*