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

Already on GitHub? Sign in to your account

Request: Filters for deferred CSS loader #105

Closed
asadkn opened this Issue Jul 22, 2017 · 2 comments

Comments

Projects
None yet
2 participants
Contributor

asadkn commented Jul 22, 2017

It would be great if we could filter the loadCSS technique and the this.rel='stylesheet' technique used. We wanted to add a callback to both onload event of the preload link style tag and replace loadCSS with a modified solution for callbacks.

Requesting filters for classes/autoptimizeStyles.php:

apply_filters( 'autoptimize_css_preload_onload', "this.rel=\'stylesheet\'" );
apply_filters( 'autoptimize_css_preload_polyfill', $preloadPolyfill );
Owner

futtta commented Jul 23, 2017

Well, if you make this a git pull request I can merge if OK :-)

Can you use autoptimize_filter_css_preload_onload and autoptimize_css_preload_polyfill though?

@asadkn asadkn added a commit to asadkn/autoptimize that referenced this issue Jul 23, 2017

@asadkn asadkn Filters for deferred CSS loader
Adding two filters as in #105
3eaec6b
Owner

futtta commented Jul 24, 2017

PR merged, thanks for your contribution! :-)

@futtta futtta closed this Jul 24, 2017

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