For some reasons, I need a function to detect all inline styles generated by theme options or plugins to be moved to the footer and convert this snippet into a small plugin.

Basically I need that all these kind of styles printed or enqueued to the header to be detected and moved to the footer with a very low priority:

<style type="text/css">
body {
color: #000;
}
</style>

or

<style>
body {
color: #000;
}
</style>

I guess this can be done using str_replace and wp_footer but how?

Thank you!

Read more here: How to detect and move all inline styles to the footer?


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Related Wordpress search:

, , , ,

Wordpress related questions and answers: