Skip to content

Commit

Permalink
Content Options: Always load Featured Images functionality if we are …
Browse files Browse the repository at this point in the history
…in the Customizer but not on the front end if all the options are ticked. (#6463)

In order to trigger the filtering function on first unclick in the
Customizer we need `( 1 === $opts['archive-option'] && 1 ===
$opts['post-option'] && 1 === $opts['page-option'] )` to return `true`.
  • Loading branch information
thomasguillot authored and zinigor committed Feb 28, 2017
1 parent 177d0e1 commit e9bd747
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/theme-tools/content-options.php
Expand Up @@ -85,9 +85,9 @@ function jetpack_featured_images_get_settings() {
function jetpack_featured_images_should_load() {
$opts = jetpack_featured_images_get_settings();

// If the theme doesn't support archive, post and page or if all the options are ticked, don't continue.
// If the theme doesn't support archive, post and page or if all the options are ticked and we aren't in the customizer, don't continue.
if ( ( true !== $opts['archive'] && true !== $opts['post'] && true !== $opts['page'] )
|| ( 1 === $opts['archive-option'] && 1 === $opts['post-option'] && 1 === $opts['page-option'] ) ) {
|| ( 1 === $opts['archive-option'] && 1 === $opts['post-option'] && 1 === $opts['page-option'] && ! is_customize_preview() ) ) {
return false;
}

Expand Down

0 comments on commit e9bd747

Please sign in to comment.