Skip to content
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

Disable WordPress 4.7 & 4.7.1 custom CSS #5

Closed
bobbingwide opened this issue Jan 10, 2017 · 1 comment
Closed

Disable WordPress 4.7 & 4.7.1 custom CSS #5

bobbingwide opened this issue Jan 10, 2017 · 1 comment
Assignees

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Jan 10, 2017

WordPress 4.7 introduced some new code that allows custom CSS to be entered in the customizer.
The custom CSS is saved as a custom post type which WordPress tries to load in the filter hook wp_custom_css_cb.

We don't need this for two reasons

  1. We have our own custom CSS code
  2. It's a performance overhead. Measured at approx 2% increase in server elapsed time.

Proposed solution

Remove the action hook.
remove_action( 'wp_head', 'wp_custom_css_cb', 11 );

@bobbingwide
Copy link
Owner Author

Looks like the hook priority has changed in 4.7.1, so we'll need:
remove_action( 'wp_head', 'wp_custom_css_cb', 101 )

@bobbingwide bobbingwide changed the title Disable WordPress 4.7 custom CSS Disable WordPress 4.7 & 4.7.1 custom CSS Jan 24, 2017
bobbingwide added a commit that referenced this issue Mar 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant