2012-02-24 23:12:43 -05:00
< ? php
/**
2014-03-04 15:21:14 -05:00
* Theme Customize Screen .
2012-02-24 23:12:43 -05:00
*
* @ package WordPress
* @ subpackage Customize
* @ since 3.4 . 0
*/
2012-06-26 14:48:18 -04:00
define ( 'IFRAME_REQUEST' , true );
2014-03-04 15:21:14 -05:00
/** Load WordPress Administration Bootstrap */
2020-02-06 01:33:11 -05:00
require_once __DIR__ . '/admin.php' ;
2014-03-04 15:21:14 -05:00
2014-07-14 15:01:16 -04:00
if ( ! current_user_can ( 'customize' ) ) {
2015-09-02 13:05:22 -04:00
wp_die (
2018-02-18 21:13:32 -05:00
'<h1>' . __ ( 'You need a higher level of permission.' ) . '</h1>' .
2016-06-29 11:16:29 -04:00
'<p>' . __ ( 'Sorry, you are not allowed to customize this site.' ) . '</p>' ,
2015-09-02 13:05:22 -04:00
403
);
2014-07-08 13:15:14 -04:00
}
2012-02-24 23:12:43 -05:00
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
Built from https://develop.svn.wordpress.org/trunk@38810
git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 16:05:31 -04:00
/**
* @ global WP_Scripts $wp_scripts
* @ global WP_Customize_Manager $wp_customize
*/
global $wp_scripts , $wp_customize ;
if ( $wp_customize -> changeset_post_id () ) {
Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
Built from https://develop.svn.wordpress.org/trunk@41626
git-svn-id: http://core.svn.wordpress.org/trunk@41461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 18:25:46 -04:00
$changeset_post = get_post ( $wp_customize -> changeset_post_id () );
if ( ! current_user_can ( get_post_type_object ( 'customize_changeset' ) -> cap -> edit_post , $changeset_post -> ID ) ) {
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
Built from https://develop.svn.wordpress.org/trunk@38810
git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 16:05:31 -04:00
wp_die (
2018-02-18 21:13:32 -05:00
'<h1>' . __ ( 'You need a higher level of permission.' ) . '</h1>' .
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
Built from https://develop.svn.wordpress.org/trunk@38810
git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 16:05:31 -04:00
'<p>' . __ ( 'Sorry, you are not allowed to edit this changeset.' ) . '</p>' ,
403
);
}
Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
Built from https://develop.svn.wordpress.org/trunk@41626
git-svn-id: http://core.svn.wordpress.org/trunk@41461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 18:25:46 -04:00
$missed_schedule = (
'future' === $changeset_post -> post_status &&
get_post_time ( 'G' , true , $changeset_post ) < time ()
);
if ( $missed_schedule ) {
2017-11-08 23:44:47 -05:00
/*
* Note that an Ajax request spawns here instead of just calling `wp_publish_post( $changeset_post->ID )` .
*
* Because WP_Customize_Manager is not instantiated for customize . php with the `settings_previewed=false`
* argument , settings cannot be reliably saved . Some logic short - circuits if the current value is the
* same as the value being saved . This is particularly true for options via `update_option()` .
*
* By opening an Ajax request , this is avoided and the changeset is published . See #39221.
*/
2017-11-30 18:11:00 -05:00
$nonces = $wp_customize -> get_nonces ();
2017-11-08 23:44:47 -05:00
$request_args = array (
2017-11-30 18:11:00 -05:00
'nonce' => $nonces [ 'save' ],
'customize_changeset_uuid' => $wp_customize -> changeset_uuid (),
'wp_customize' => 'on' ,
2017-11-08 23:44:47 -05:00
'customize_changeset_status' => 'publish' ,
);
ob_start ();
?>
< ? php wp_print_scripts ( array ( 'wp-util' ) ); ?>
< script >
wp . ajax . post ( 'customize_save' , < ? php echo wp_json_encode ( $request_args ); ?> );
</ script >
< ? php
$script = ob_get_clean ();
Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
Built from https://develop.svn.wordpress.org/trunk@41626
git-svn-id: http://core.svn.wordpress.org/trunk@41461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 18:25:46 -04:00
wp_die (
'<h1>' . __ ( 'Your scheduled changes just published' ) . '</h1>' .
2017-11-08 23:44:47 -05:00
'<p><a href="' . esc_url ( remove_query_arg ( 'changeset_uuid' ) ) . '">' . __ ( 'Customize New Changes' ) . '</a></p>' . $script ,
Customize: Introduce drafting and scheduling for Customizer changesets.
* Incorporates code from the Customize Snapshots and Customize Posts feature plugins.
* Adds a new Publish Settings section for managing the changeset status, scheduled date, and frontend preview link.
* Updates Publish button to reflect the status selected in the Publish Settings (including Save Draft and Schedule).
* Deactivates the Themes section when a non-publish status selected, and deactivates the Publish Settings section when previewing a theme switch.
* Introduces an `outer` section type (`wp.customize.OuterSection` in JS) for the Publish Settings section to use and for available widgets and available nav menu panels to use in the future. These sections can be expanded while other sections are expanded.
* Introduces `WP_Customize_Date_Time_Control` in PHP and `wp.customize.DateTimeControl` in JS for managing a date/time value.
* Keeps track of scheduled time and proactively publish from the client when the time arrives, as opposed to waiting for WP Cron.
* Auto-publishes a scheduled changeset when attempting to access one that missed its schedule.
* Starts a new changeset if attempting to save a changeset that was previously publish.
* Adds `force` arg to `requestChangesetUpdate()` to force an update request even when there are no pending changes.
* Adds utils methods for `getCurrentTimestamp` and `getRemainingTime`.
* Adds new state values for `selectedChangesetStatus`, `changesetDate`, `selectedChangesetDate`.
* Fixes logic for when to short-circuit check to close Customizer when there are unsaved changes.
* Adds getter methods for `autosaved` and `branching` parameters, with the latter applying the `customize_changeset_branching` filter.
* Call to `establish_loaded_changeset` on the fly when `changeset_uuid()` is called if no changeset UUID was specififed.
* De-duplicates logic for dismissing auto-draft changesets.
* Includes unit tests.
Builds on [41597].
Props sayedwp, westonruter, melchoyce, JoshuaWold, folletto, stubgo, karmatosed, dlh, paaljoachim, afercia, johnregan3, utkarshpatel, valendesigns.
See #30937.
Fixes #39896, #28721, #39275.
Built from https://develop.svn.wordpress.org/trunk@41626
git-svn-id: http://core.svn.wordpress.org/trunk@41461 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-27 18:25:46 -04:00
200
);
}
if ( in_array ( get_post_status ( $changeset_post -> ID ), array ( 'publish' , 'trash' ), true ) ) {
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
Built from https://develop.svn.wordpress.org/trunk@38810
git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 16:05:31 -04:00
wp_die (
2018-02-18 21:13:32 -05:00
'<h1>' . __ ( 'Something went wrong.' ) . '</h1>' .
2017-11-10 17:51:46 -05:00
'<p>' . __ ( 'This changeset cannot be further modified.' ) . '</p>' .
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
Built from https://develop.svn.wordpress.org/trunk@38810
git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 16:05:31 -04:00
'<p><a href="' . esc_url ( remove_query_arg ( 'changeset_uuid' ) ) . '">' . __ ( 'Customize New Changes' ) . '</a></p>' ,
403
);
}
}
Customize: Sanitize autofocus URL parameter as an array.
[58069] introduced calling `sanitize_text_field()` with `$_REQUEST['autofocus']` (which is an array) and setting its default to a `string`. This fix restores the `array` data type for `autofocus`.
The fix also relocates the unsplash for `url`, `return`, and `autofocus` before sanitizing.
Follow-up to [58069], [34269], [29026], [21028].
Props jamesros161, swissspidy, dlh, audrasjb, hellofromTonya, ironprogrammer.
Fixes #61561.
Built from https://develop.svn.wordpress.org/trunk@58804
git-svn-id: http://core.svn.wordpress.org/trunk@58200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 12:23:17 -04:00
$url = ! empty ( $_REQUEST [ 'url' ] ) ? sanitize_text_field ( wp_unslash ( $_REQUEST [ 'url' ] ) ) : '' ;
$return = ! empty ( $_REQUEST [ 'return' ] ) ? sanitize_text_field ( wp_unslash ( $_REQUEST [ 'return' ] ) ) : '' ;
$autofocus = ! empty ( $_REQUEST [ 'autofocus' ] ) && is_array ( $_REQUEST [ 'autofocus' ] )
? array_map ( 'sanitize_text_field' , wp_unslash ( $_REQUEST [ 'autofocus' ] ) )
: array ();
Customize: Implement customized state persistence with changesets.
Includes infrastructure developed in the Customize Snapshots feature plugin.
See https://make.wordpress.org/core/2016/10/12/customize-changesets-technical-design-decisions/
Props westonruter, valendesigns, utkarshpatel, stubgo, lgedeon, ocean90, ryankienstra, mihai2u, dlh, aaroncampbell, jonathanbardo, jorbin.
See #28721.
See #31089.
Fixes #30937.
Fixes #31517.
Fixes #30028.
Fixes #23225.
Fixes #34142.
Fixes #36485.
Built from https://develop.svn.wordpress.org/trunk@38810
git-svn-id: http://core.svn.wordpress.org/trunk@38753 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2016-10-18 16:05:31 -04:00
2015-09-17 15:42:26 -04:00
if ( ! empty ( $url ) ) {
Customize: Sanitize autofocus URL parameter as an array.
[58069] introduced calling `sanitize_text_field()` with `$_REQUEST['autofocus']` (which is an array) and setting its default to a `string`. This fix restores the `array` data type for `autofocus`.
The fix also relocates the unsplash for `url`, `return`, and `autofocus` before sanitizing.
Follow-up to [58069], [34269], [29026], [21028].
Props jamesros161, swissspidy, dlh, audrasjb, hellofromTonya, ironprogrammer.
Fixes #61561.
Built from https://develop.svn.wordpress.org/trunk@58804
git-svn-id: http://core.svn.wordpress.org/trunk@58200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 12:23:17 -04:00
$wp_customize -> set_preview_url ( $url );
2014-07-08 13:15:14 -04:00
}
2015-09-17 15:42:26 -04:00
if ( ! empty ( $return ) ) {
Customize: Sanitize autofocus URL parameter as an array.
[58069] introduced calling `sanitize_text_field()` with `$_REQUEST['autofocus']` (which is an array) and setting its default to a `string`. This fix restores the `array` data type for `autofocus`.
The fix also relocates the unsplash for `url`, `return`, and `autofocus` before sanitizing.
Follow-up to [58069], [34269], [29026], [21028].
Props jamesros161, swissspidy, dlh, audrasjb, hellofromTonya, ironprogrammer.
Fixes #61561.
Built from https://develop.svn.wordpress.org/trunk@58804
git-svn-id: http://core.svn.wordpress.org/trunk@58200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 12:23:17 -04:00
$wp_customize -> set_return_url ( $return );
2015-09-17 15:42:26 -04:00
}
Customize: Sanitize autofocus URL parameter as an array.
[58069] introduced calling `sanitize_text_field()` with `$_REQUEST['autofocus']` (which is an array) and setting its default to a `string`. This fix restores the `array` data type for `autofocus`.
The fix also relocates the unsplash for `url`, `return`, and `autofocus` before sanitizing.
Follow-up to [58069], [34269], [29026], [21028].
Props jamesros161, swissspidy, dlh, audrasjb, hellofromTonya, ironprogrammer.
Fixes #61561.
Built from https://develop.svn.wordpress.org/trunk@58804
git-svn-id: http://core.svn.wordpress.org/trunk@58200 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2024-07-24 12:23:17 -04:00
if ( ! empty ( $autofocus ) ) {
$wp_customize -> set_autofocus ( $autofocus );
2014-07-08 13:15:14 -04:00
}
2012-06-08 14:45:12 -04:00
2024-12-02 18:36:18 -05:00
// Let's roll.
header ( 'Content-Type: ' . get_option ( 'html_type' ) . '; charset=' . get_option ( 'blog_charset' ) );
wp_user_settings ();
_wp_admin_html_begin ();
2017-11-30 18:11:00 -05:00
$registered = $wp_scripts -> registered ;
2022-11-29 10:51:14 -05:00
$wp_scripts = new WP_Scripts ();
2012-02-24 23:12:43 -05:00
$wp_scripts -> registered = $registered ;
2017-11-30 18:11:00 -05:00
add_action ( 'customize_controls_print_scripts' , 'print_head_scripts' , 20 );
add_action ( 'customize_controls_print_footer_scripts' , '_wp_footer_scripts' );
add_action ( 'customize_controls_print_styles' , 'print_admin_styles' , 20 );
2012-02-24 23:12:43 -05:00
2013-10-24 18:53:23 -04:00
/**
* Fires when Customizer controls are initialized , before scripts are enqueued .
*
* @ since 3.4 . 0
*/
2012-02-24 23:12:43 -05:00
do_action ( 'customize_controls_init' );
2017-10-12 00:01:46 -04:00
wp_enqueue_script ( 'heartbeat' );
2012-02-24 23:12:43 -05:00
wp_enqueue_script ( 'customize-controls' );
wp_enqueue_style ( 'customize-controls' );
2013-10-24 18:53:23 -04:00
/**
2023-06-14 10:08:18 -04:00
* Fires when enqueuing Customizer control scripts .
2013-10-24 18:53:23 -04:00
*
* @ since 3.4 . 0
*/
2012-02-24 23:12:43 -05:00
do_action ( 'customize_controls_enqueue_scripts' );
2013-11-11 12:39:09 -05:00
$body_class = 'wp-core-ui wp-customizer js' ;
2012-06-06 17:45:17 -04:00
if ( wp_is_mobile () ) :
$body_class .= ' mobile' ;
Administration: Remove multiple viewport meta tags from mobile pages.
In addition, add the `wp_admin_viewport_meta()` function, paired to the `admin_viewport_meta` filter to control attributes of the meta tag.
Fixes #47369.
Props BettyJJ, mukesh27, SergeyBiryukov, ajayghaghretiya1, msaggiorato, talldanwp, davidbaumwald, donmhico, audrasjb.
Built from https://develop.svn.wordpress.org/trunk@48412
git-svn-id: http://core.svn.wordpress.org/trunk@48181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-09 19:29:08 -04:00
add_filter ( 'admin_viewport_meta' , '_customizer_mobile_viewport_meta' );
2012-06-06 17:45:17 -04:00
endif ;
2015-09-17 15:42:26 -04:00
if ( $wp_customize -> is_ios () ) {
2012-06-06 17:45:17 -04:00
$body_class .= ' ios' ;
2014-11-11 17:29:23 -05:00
}
2012-06-06 17:45:17 -04:00
2014-11-11 17:29:23 -05:00
if ( is_rtl () ) {
$body_class .= ' rtl' ;
}
2017-04-04 22:16:02 -04:00
$body_class .= ' locale-' . sanitize_html_class ( strtolower ( str_replace ( '_' , '-' , get_user_locale () ) ) );
2012-11-08 17:01:06 -05:00
2021-09-01 03:10:56 -04:00
if ( wp_use_widgets_block_editor () ) {
$body_class .= ' wp-embed-responsive' ;
}
2015-09-17 15:42:26 -04:00
$admin_title = sprintf ( $wp_customize -> get_document_title_template (), __ ( 'Loading…' ) );
2014-11-11 17:29:23 -05:00
2017-11-30 18:11:00 -05:00
?>
2020-03-19 22:20:08 -04:00
< title >< ? php echo esc_html ( $admin_title ); ?> </title>
2012-02-24 23:12:43 -05:00
2013-11-11 10:47:09 -05:00
< script type = " text/javascript " >
Customize: Introduce a new experience for discovering, installing, and previewing themes within the customizer.
Unify the theme-browsing and theme-customization experiences by introducing a comprehensive theme browser and installer directly accessible in the customizer. Replaces the customizer theme switcher with a full-screen panel for discovering/browsing and installing themes available on WordPress.org. Themes can now be installed and previewed directly in the customizer without entering the wp-admin context. Also includes an extensible framework for browsing and installing themes from other sources.
Also includes CSS auto-prefixing added via `grunt precommit:css`.
For details, see: https://make.wordpress.org/core/2016/10/03/feature-proposal-a-new-experience-for-discovering-installing-and-previewing-themes-in-the-customizer/
Previously [38813] but reverted in [39140].
Fixes #37661, #34843, #38666.
Props celloexpressions, folletto, westonruter, karmatosed, melchoyce, afercia.
Built from https://develop.svn.wordpress.org/trunk@41648
git-svn-id: http://core.svn.wordpress.org/trunk@41482 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-29 16:13:50 -04:00
var ajaxurl = < ? php echo wp_json_encode ( admin_url ( 'admin-ajax.php' , 'relative' ) ); ?> ,
pagenow = 'customize' ;
2013-11-11 10:47:09 -05:00
</ script >
< ? php
2013-10-24 18:53:23 -04:00
/**
2014-03-25 04:05:15 -04:00
* Fires when Customizer control styles are printed .
2013-10-24 18:53:23 -04:00
*
* @ since 3.4 . 0
*/
2012-02-24 23:12:43 -05:00
do_action ( 'customize_controls_print_styles' );
2013-10-24 18:53:23 -04:00
/**
2014-03-25 04:05:15 -04:00
* Fires when Customizer control scripts are printed .
2013-10-24 18:53:23 -04:00
*
* @ since 3.4 . 0
*/
2012-02-24 23:12:43 -05:00
do_action ( 'customize_controls_print_scripts' );
Administration: Remove multiple viewport meta tags from mobile pages.
In addition, add the `wp_admin_viewport_meta()` function, paired to the `admin_viewport_meta` filter to control attributes of the meta tag.
Fixes #47369.
Props BettyJJ, mukesh27, SergeyBiryukov, ajayghaghretiya1, msaggiorato, talldanwp, davidbaumwald, donmhico, audrasjb.
Built from https://develop.svn.wordpress.org/trunk@48412
git-svn-id: http://core.svn.wordpress.org/trunk@48181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-09 19:29:08 -04:00
/**
2020-07-10 07:36:07 -04:00
* Fires in head section of Customizer controls .
Administration: Remove multiple viewport meta tags from mobile pages.
In addition, add the `wp_admin_viewport_meta()` function, paired to the `admin_viewport_meta` filter to control attributes of the meta tag.
Fixes #47369.
Props BettyJJ, mukesh27, SergeyBiryukov, ajayghaghretiya1, msaggiorato, talldanwp, davidbaumwald, donmhico, audrasjb.
Built from https://develop.svn.wordpress.org/trunk@48412
git-svn-id: http://core.svn.wordpress.org/trunk@48181 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2020-07-09 19:29:08 -04:00
*
* @ since 5.5 . 0
*/
do_action ( 'customize_controls_head' );
2012-02-24 23:12:43 -05:00
?>
</ head >
2012-06-06 17:45:17 -04:00
< body class = " <?php echo esc_attr( $body_class ); ?> " >
< div class = " wp-full-overlay expanded " >
2012-04-30 11:46:17 -04:00
< form id = " customize-controls " class = " wrap wp-full-overlay-sidebar " >
2012-05-14 21:03:31 -04:00
< div id = " customize-header-actions " class = " wp-full-overlay-header " >
2020-05-18 08:32:10 -04:00
< ? php
$compatible_wp = is_wp_version_compatible ( $wp_customize -> theme () -> get ( 'RequiresWP' ) );
$compatible_php = is_php_version_compatible ( $wp_customize -> theme () -> get ( 'RequiresPHP' ) );
?>
2021-11-08 10:27:59 -05:00
< ? php if ( $compatible_wp && $compatible_php ) : ?>
2020-05-18 08:32:10 -04:00
< ? php $save_text = $wp_customize -> is_theme_active () ? __ ( 'Publish' ) : __ ( 'Activate & Publish' ); ?>
< div id = " customize-save-button-wrapper " class = " customize-save-button-wrapper " >
< ? php submit_button ( $save_text , 'primary save' , 'save' , false ); ?>
< button id = " publish-settings " class = " publish-settings button-primary button dashicons dashicons-admin-generic " aria - label = " <?php esc_attr_e( 'Publish Settings' ); ?> " aria - expanded = " false " disabled ></ button >
</ div >
< ? php else : ?>
< ? php $save_text = _x ( 'Cannot Activate' , 'theme' ); ?>
< div id = " customize-save-button-wrapper " class = " customize-save-button-wrapper disabled " >
< button class = " button button-primary disabled " aria - label = " <?php esc_attr_e( 'Publish Settings' ); ?> " aria - expanded = " false " disabled >< ? php echo $save_text ; ?> </button>
</ div >
< ? php endif ; ?>
2015-08-09 15:00:24 -04:00
< span class = " spinner " ></ span >
2016-04-17 11:41:27 -04:00
< button type = " button " class = " customize-controls-preview-toggle " >
2015-08-09 15:00:24 -04:00
< span class = " controls " >< ? php _e ( 'Customize' ); ?> </span>
< span class = " preview " >< ? php _e ( 'Preview' ); ?> </span>
2016-04-17 11:41:27 -04:00
</ button >
2015-09-17 15:42:26 -04:00
< a class = " customize-controls-close " href = " <?php echo esc_url( $wp_customize->get_return_url () ); ?> " >
I18N: Mark screen reader strings as such with translator comments.
This aims to provide better context for translators and make it easier to determine that some strings contain hidden accessibility text and are not displayed in the UI.
Props kebbet, mercime, pavelevap, ocean90, swissspidy, Chouby, jipmoors, afercia, desrosj, costdev, audrasjb, SergeyBiryukov.
Fixes #29748.
Built from https://develop.svn.wordpress.org/trunk@55276
git-svn-id: http://core.svn.wordpress.org/trunk@54809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 12:10:21 -05:00
< span class = " screen-reader-text " >
< ? php
/* translators: Hidden accessibility text. */
_e ( 'Close the Customizer and go back to the previous page' );
?>
</ span >
2015-08-09 15:00:24 -04:00
</ a >
2012-04-16 10:02:28 -04:00
</ div >
2012-11-17 10:11:29 -05:00
2017-10-09 19:01:46 -04:00
< div id = " customize-sidebar-outer-content " >
< div id = " customize-outer-theme-controls " >
< ul class = " customize-outer-pane-parent " >< ? php // Outer panel and sections are not implemented, but its here as a placeholder to avoid any side-effect in api.Section. ?></ul>
</ div >
</ div >
2016-01-30 08:46:27 -05:00
< div id = " widgets-right " class = " wp-clearfix " ><!-- For Widget Customizer , many widgets try to look for instances under div #widgets-right, so we have to add that ID to a container div in the Customizer for compat -->
Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.
Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.
Built from https://develop.svn.wordpress.org/trunk@41374
git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 03:03:46 -04:00
< div id = " customize-notifications-area " class = " customize-control-notifications-container " >
< ul ></ ul >
2012-03-03 21:06:11 -05:00
</ div >
Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.
Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.
Built from https://develop.svn.wordpress.org/trunk@41374
git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 03:03:46 -04:00
< div class = " wp-full-overlay-sidebar-content " tabindex = " -1 " >
2022-03-29 15:10:14 -04:00
< div id = " customize-info " class = " accordion-section customize-info " data - block - theme = " <?php echo (int) wp_is_block_theme(); ?> " >
Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.
Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.
Built from https://develop.svn.wordpress.org/trunk@41374
git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 03:03:46 -04:00
< div class = " accordion-section-title " >
2017-11-30 18:11:00 -05:00
< span class = " preview-notice " >
< ? php
2019-09-02 20:41:05 -04:00
/* translators: %s: The site/panel title in the Customizer. */
2020-06-20 09:18:11 -04:00
printf ( __ ( 'You are customizing %s' ), '<strong class="panel-title site-title">' . get_bloginfo ( 'name' , 'display' ) . '</strong>' );
2017-11-30 18:11:00 -05:00
?>
</ span >
I18N: Mark screen reader strings as such with translator comments.
This aims to provide better context for translators and make it easier to determine that some strings contain hidden accessibility text and are not displayed in the UI.
Props kebbet, mercime, pavelevap, ocean90, swissspidy, Chouby, jipmoors, afercia, desrosj, costdev, audrasjb, SergeyBiryukov.
Fixes #29748.
Built from https://develop.svn.wordpress.org/trunk@55276
git-svn-id: http://core.svn.wordpress.org/trunk@54809 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2023-02-07 12:10:21 -05:00
< button type = " button " class = " customize-help-toggle dashicons dashicons-editor-help " aria - expanded = " false " >< span class = " screen-reader-text " >
< ? php
/* translators: Hidden accessibility text. */
_e ( 'Help' );
?>
</ span ></ button >
Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.
Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.
Built from https://develop.svn.wordpress.org/trunk@41374
git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 03:03:46 -04:00
</ div >
2017-11-30 18:11:00 -05:00
< div class = " customize-panel-description " >
2021-11-08 16:43:01 -05:00
< p >
< ? php
2022-03-29 15:10:14 -04:00
_e ( 'The Customizer allows you to preview changes to your site before publishing them. You can navigate to different pages on your site within the preview. Edit shortcuts are shown for some editable elements. The Customizer is intended for use with non-block themes.' );
2021-11-08 16:43:01 -05:00
?>
</ p >
< p >
< ? php
2023-02-28 07:52:18 -05:00
_e ( '<a href="https://wordpress.org/documentation/article/customizer/">Documentation on Customizer</a>' );
2021-11-08 16:43:01 -05:00
?>
</ p >
2017-11-30 18:11:00 -05:00
</ div >
Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.
Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.
Built from https://develop.svn.wordpress.org/trunk@41374
git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 03:03:46 -04:00
</ div >
2012-02-24 23:12:43 -05:00
Customize: Add global notifications area.
* Displays an error notification in the global area when a save attempt is rejected due to invalid settings. An error notification is also displayed when saving fails due to a network error or server error.
* Introduces `wp.customize.Notifications` subclass of `wp.customize.Values` to contain instances of `wp.customize.Notification` and manage their rendering into a container.
* Exposes the global notification area as `wp.customize.notifications` collection instance.
* Updates the `notifications` object on `Control` to use `Notifications` rather than `Values` and to re-use the rendering logic from the former. The old `Control#renderNotifications` method is deprecated.
* Allows notifications to be dismissed by instantiating them with a `dismissible` property.
* Allows `wp.customize.Notification` to be extended with custom templates and `render` functions.
* Triggers a `removed` event on `wp.customize.Values` instances _after_ a value has been removed from the collection.
Props delawski, westonruter, karmatosed, celloexpressions, Fab1en, melchoyce, Kelderic, afercia, adamsilverstein.
See #34893, #39896.
Fixes #35210, #31582, #37727, #37269.
Built from https://develop.svn.wordpress.org/trunk@41374
git-svn-id: http://core.svn.wordpress.org/trunk@41207 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2017-09-12 03:03:46 -04:00
< div id = " customize-theme-controls " >
< ul class = " customize-pane-parent " >< ? php // Panels and sections are managed here via JavaScript ?></ul>
</ div >
Improve/introduce Customizer JavaScript models for Controls, Sections, and Panels.
* Introduce models for panels and sections.
* Introduce API to expand and focus a control, section or panel.
* Allow deep-linking to panels, sections, and controls inside of the Customizer.
* Clean up `accordion.js`, removing all Customizer-specific logic.
* Add initial unit tests for `wp.customize.Class` in `customize-base.js`.
https://make.wordpress.org/core/2014/10/27/toward-a-complete-javascript-api-for-the-customizer/ provides an overview of how to use the JavaScript API.
props westonruter, celloexpressions, ryankienstra.
see #28032, #28579, #28580, #28650, #28709, #29758.
fixes #29529.
Built from https://develop.svn.wordpress.org/trunk@30102
git-svn-id: http://core.svn.wordpress.org/trunk@30102 1a063a9b-81f0-0310-95a4-ce76da25c4cd
2014-10-29 18:51:22 -04:00
</ div >
2012-05-14 21:03:31 -04:00
</ div >
2012-02-24 23:12:43 -05:00
2012-05-14 21:03:31 -04:00
< div id = " customize-footer-actions " class = " wp-full-overlay-footer " >
2021-05-19 14:10:59 -04:00
< button type = " button " class = " collapse-sidebar button " aria - expanded = " true " aria - label = " <?php echo esc_attr_x( 'Hide Controls', 'label for hide controls button without length constraints' ); ?> " >
2012-04-16 10:02:28 -04:00
< span class = " collapse-sidebar-arrow " ></ span >
2016-11-13 14:00:35 -05:00
< span class = " collapse-sidebar-label " >< ? php _ex ( 'Hide Controls' , 'short (~12 characters) label for hide controls button' ); ?> </span>
2015-07-10 17:22:26 -04:00
</ button >
2017-04-21 01:16:45 -04:00
< ? php $previewable_devices = $wp_customize -> get_previewable_devices (); ?>
< ? php if ( ! empty ( $previewable_devices ) ) : ?>
< div class = " devices-wrapper " >
< div class = " devices " >
< ? php foreach ( ( array ) $previewable_devices as $device => $settings ) : ?>
< ? php
if ( empty ( $settings [ 'label' ] ) ) {
continue ;
}
$active = ! empty ( $settings [ 'default' ] );
2017-11-30 18:11:00 -05:00
$class = 'preview-' . $device ;
2017-04-21 01:16:45 -04:00
if ( $active ) {
$class .= ' active' ;
}
?>
2017-11-30 18:11:00 -05:00
< button type = " button " class = " <?php echo esc_attr( $class ); ?> " aria - pressed = " <?php echo esc_attr( $active ); ?> " data - device = " <?php echo esc_attr( $device ); ?> " >
2017-04-21 01:16:45 -04:00
< span class = " screen-reader-text " >< ? php echo esc_html ( $settings [ 'label' ] ); ?> </span>
</ button >
< ? php endforeach ; ?>
</ div >
</ div >
< ? php endif ; ?>
2012-02-24 23:12:43 -05:00
</ div >
</ form >
2012-04-30 11:46:17 -04:00
< div id = " customize-preview " class = " wp-full-overlay-main " ></ div >
2012-02-24 23:12:43 -05:00
< ? php
2013-10-24 18:53:23 -04:00
/**
2016-05-25 12:05:27 -04:00
* Prints templates , control scripts , and settings in the footer .
2013-10-24 18:53:23 -04:00
*
* @ since 3.4 . 0
*/
2012-02-24 23:12:43 -05:00
do_action ( 'customize_controls_print_footer_scripts' );
?>
2012-06-06 17:45:17 -04:00
</ div >
2012-02-24 23:12:43 -05:00
</ body >
</ html >