• Resolved pyrotechnicsfreak

    (@pyrotechnicsfreak)


    I’m writing a plugin for the first time. This is what I want to achieve:

    Page/post writers must be able to place defined tags/ubb in a post or page. When a user enters [includeScriptToHead]path/to/script.js[/includeScriptToHead]. The path to the script has to be replaced and used withing the <script> tag. This <script> tag must be outputted in wp_head. So we get something like this for example:

    <head>
    <script type=”text/javascript” src=”path/to/script.js”></script>
    </head>

    I can do a preg_replace_all() when I add a hook to the_content and save the output to a session for later use in wp_head. But wp_head isn’t called anymore after the_content. So I was thinking to get the page/post content in my wp_hook function extension, but I can’t find out how to get the content there.

    I hope my description is clear enough. If not, let me know. ??

    Thanks allot!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Fetch the page content in wp_head?’ is closed to new replies.