Skip to content
This repository was archived by the owner on Dec 27, 2022. It is now read-only.

Commit 023a0a6

Browse files
committed
Save previewing theme with customizer state query params.
1 parent 80fe277 commit 023a0a6

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

js/customize-snapshots.js

+4
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@
115115
queryVars.device = api.previewedDevice.get();
116116
queryVars.url = api.previewer.previewUrl.get();
117117

118+
if ( ! api.state( 'activated' ).get() ) {
119+
queryVars.previewingTheme = true;
120+
}
121+
118122
_.find( [ 'control', 'section', 'panel' ], function( constructType ) {
119123
var found = false;
120124
api[ constructType ].each( function( construct ) { // @todo Core needs to support more Backbone methods on wp.customize.Values().

php/class-post-type.php

+3
Original file line numberDiff line numberDiff line change
@@ -898,6 +898,9 @@ public function set_customizer_state_query_vars( $post_id, $query_vars ) {
898898
if ( isset( $query_vars['scroll'] ) && is_int( $query_vars['scroll'] ) ) {
899899
$stored_query_vars['scroll'] = $query_vars['scroll'];
900900
}
901+
if ( isset( $query_vars['previewingTheme'] ) ) {
902+
$stored_query_vars['theme'] = $this->snapshot_manager->customize_manager->get_stylesheet();
903+
}
901904
update_post_meta( $post_id, '_preview_url_query_vars', $stored_query_vars );
902905
return $stored_query_vars;
903906
}

0 commit comments

Comments
 (0)