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

Commit

Permalink
Revert the previewingTheme value.
Browse files Browse the repository at this point in the history
  • Loading branch information
mohdsayed committed Mar 21, 2017
1 parent a71adbb commit eb003e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion php/class-customize-snapshot-manager-back-compat.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ public function enqueue_controls_scripts() {
if ( $this->snapshot ) {
$post = $this->snapshot->post();
$this->override_post_date_default_data( $post );
$preview_url_query_vars = $this->post_type->get_customizer_state_query_vars( $post->ID );
}

// Script data array.
Expand All @@ -101,7 +102,7 @@ public function enqueue_controls_scripts() {
'initialServerDate' => current_time( 'mysql', false ),
'initialServerTimestamp' => floor( microtime( true ) * 1000 ),
'theme' => $this->original_stylesheet,
'previewingTheme' => ! $this->customize_manager->is_theme_active(),
'previewingTheme' => isset( $preview_url_query_vars['theme'] ) ? $preview_url_query_vars['theme'] : '',
'i18n' => array(
'saveButton' => __( 'Save', 'customize-snapshots' ),
'updateButton' => __( 'Update', 'customize-snapshots' ),
Expand Down
3 changes: 2 additions & 1 deletion php/class-customize-snapshot-manager.php
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ public function enqueue_controls_scripts() {
if ( $this->snapshot ) {
$post_id = $this->customize_manager->changeset_post_id();
$post = get_post( $post_id );
$preview_url_query_vars = $this->post_type->get_customizer_state_query_vars( $post->ID );
if ( $post instanceof \WP_Post ) {
$this->override_post_date_default_data( $post );
$edit_link = $this->snapshot->get_edit_link( $post );
Expand All @@ -289,7 +290,7 @@ public function enqueue_controls_scripts() {
'currentUserCanPublish' => current_user_can( 'customize_publish' ),
'initialServerDate' => current_time( 'mysql', false ),
'initialServerTimestamp' => floor( microtime( true ) * 1000 ),
'previewingTheme' => ! $this->customize_manager->is_theme_active(),
'previewingTheme' => isset( $preview_url_query_vars['theme'] ) ? $preview_url_query_vars['theme'] : '',
'i18n' => array(
'saveButton' => __( 'Save', 'customize-snapshots' ),
'updateButton' => __( 'Update', 'customize-snapshots' ),
Expand Down

0 comments on commit eb003e3

Please sign in to comment.