New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add customizer theme support #952

Merged
merged 7 commits into from Feb 22, 2018

Conversation

Projects
None yet
3 participants
@westonruter
Member

westonruter commented Feb 10, 2018

  • Make sure sanitizer is run in rendered partials.
  • Add AMP component scripts when selective refresh results in a new component added. Irrelevant since AMP apparently does this automatically.
  • Make sure scripts are allowed to be output when is_customize_preview(). Scripts need to be enqueued regardless of the user being in the iframe since frontend previewing depends on JS injecting the customize_changeset_uuid into requests.
  • Suspend CSS sanitizer to facilitate JS-based live previews.
  • Suspend limit on CSS size so that customize-preview.css can be included.

Fixes #901.

@westonruter westonruter added this to the v0.7 milestone Feb 10, 2018

@westonruter

This comment has been minimized.

Member

westonruter commented Feb 12, 2018

@DavidCramer FYI: Note the re-organization here for form handling. This will probably impact #936

@westonruter westonruter requested a review from ThierryA Feb 12, 2018

@DavidCramer

This comment has been minimized.

Contributor

DavidCramer commented Feb 12, 2018

Thanks @westonruter .

@westonruter westonruter changed the title [WIP] Add customizer theme support Add customizer theme support Feb 12, 2018

@ThierryA
Collaborator

ThierryA left a comment

Good step forward towards separating Theme Support from the legacy templates. I left a few comments which may be addressed depending on the answers, otherwise this is good to go once merge conflicts will be reloved.

@@ -178,6 +207,7 @@ public static function register_hooks() {
*/
add_action( 'template_redirect', array( __CLASS__, 'start_output_buffering' ), 0 );
// Commenting hooks.

This comment has been minimized.

@ThierryA

ThierryA Feb 22, 2018

Collaborator

During the upcoming cleanup, I would suggest to move comments, widgets etc. in their on classes.

add_filter( 'comment_post_redirect', function() {
// We don't need any data, so just send a success.
wp_send_json_success();
}, PHP_INT_MAX, 2 );

This comment has been minimized.

@ThierryA

ThierryA Feb 22, 2018

Collaborator

Why passing 2 args here, I believe this is perhaps a left over?

}, PHP_INT_MAX, 2 );
self::handle_xhr_headers_output();
} elseif ( ! empty( self::$purged_amp_query_vars['_wp_amp_action_xhr_converted'] ) ) {
add_filter( 'wp_redirect', array( __CLASS__, 'intercept_post_request_redirect' ), PHP_INT_MAX, 2 );

This comment has been minimized.

@ThierryA

ThierryA Feb 22, 2018

Collaborator

Why passing 2 args here, I believe this is perhaps a left over?

// Dequeue styles unnecessary unless in customizer preview iframe when editing (such as for edit shortcuts).
if ( ! self::is_customize_preview_iframe() ) {
wp_dequeue_style( 'customize-preview' );

This comment has been minimized.

@ThierryA

ThierryA Feb 22, 2018

Collaborator

What about just doing wp_deregister_style( 'customize-preview' ); so that we don't have to loop through dependencies?

This comment has been minimized.

@westonruter

westonruter Feb 22, 2018

Member

That could work, but it would also result in something like Query Monitor issuing a warning about a dependency missing.

@westonruter westonruter merged commit ac753c4 into develop Feb 22, 2018

2 checks passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details

@westonruter westonruter deleted the add/customizer-theme-support branch Feb 22, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment