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

Commit

Permalink
Include customized state in fetch-settings requests
Browse files Browse the repository at this point in the history
  • Loading branch information
westonruter committed Sep 29, 2016
1 parent f082137 commit 0df94bb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions js/customize-posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -308,6 +308,7 @@
request = wp.ajax.post( 'customize-posts-fetch-settings', {
'customize-posts-nonce': api.settings.nonce['customize-posts'],
'wp_customize': 'on',
'customized': api.previewer.query().customized,
'post_ids': newPostIds
} );

Expand Down
3 changes: 3 additions & 0 deletions php/class-wp-customize-posts.php
Original file line number Diff line number Diff line change
Expand Up @@ -1322,10 +1322,13 @@ public function ajax_fetch_settings() {
wp_send_json_error( 'bad_post_ids' );
}

$this->manager->add_dynamic_settings( array_keys( $this->manager->unsanitized_post_values() ) );

$setting_params = array();
$settings = $this->get_settings( $post_ids );
foreach ( $settings as $setting ) {
if ( $setting->check_capabilities() ) {
$setting->preview();

This comment has been minimized.

Copy link
@valendesigns

valendesigns Oct 18, 2016

Contributor

@westonruter This has broken BOD. Specifically the values in postmeta settings are not being added to the control even though they are stored in the DB. So you see an empty input instead of the actual value.

This comment has been minimized.

Copy link
@westonruter

westonruter Oct 18, 2016

Author Contributor

Strange 😦 I'm not sure why that would be.

This comment has been minimized.

Copy link
@westonruter

westonruter Oct 18, 2016

Author Contributor

TBH, I can't remember exactly why I added it.

This comment has been minimized.

Copy link
@westonruter

westonruter Oct 18, 2016

Author Contributor

Issue should be fixed now, props @PatelUtkarsh: #309

$setting_params[ $setting->id ] = $this->get_setting_params( $setting );
}
}
Expand Down

0 comments on commit 0df94bb

Please sign in to comment.