Forums

Filter to grab wp_head contents (2 posts)

  1. mchynes
    Member
    Posted 1 year ago #

    Hey,

    I've looked through the docs extensively—Action Reference, Filter Reference—even gone through some of the source files like general-template.php and default-filters.php to try and find a hook that allows me to grab and manipulate (for purposes of cache busting within my plugin) the contents of the wp_head function. More specifically, the output of the functions wp_print_styles, and wp_print_head_scripts.

    If anyone could help me with a link to an appropriate and existing filter, or suggest where I can go in order to get access to this particular part of the page rendering (without modifying the core, of course) it would be greatly appreciated.

    Cheers.

  2. thaindian
    Member
    Posted 1 year ago #

    Looking for solution for the exact same thing. posted at http://wordpress.org/support/topic/manipulate-wp_head

    One method is by manupilating the php output buffer just before and after wp_head() . but im looking for a more elegant solution.

    ob_start();
    wp_head();
    var_dump(ob_get_clean());

Topic Closed

This topic has been closed to new replies.

About this Topic