The Support Forums will be in read-only mode for a scheduled maintenance window on 01 September 2016 14:00 UTC - 20:00 UTC. More information.

Filtering wp_head output (3 posts)

  1. TrevorBramble
    Posted 9 years ago #

    Hi, I'm writing a plugin that will make all WordPress-generated tags appropriate for HTML rather than XHTML, and to that end I've run into a brick wall with the wp_head function.

    At the very least, wp_head spits out the xmlrpc link which is a self-closing singleton. While self-closing singletons are tolerated by HTML within the body, they are explicitly disallowed within the head of a document. The problem is that I can find no way of filtering the output of this line, to remove the " /" characters.

    Of course the root cause is still that WordPress writes XHTML tags, so if anyone has a better solution that addresses this, I'm all ears. =^)

    Obviously anyone who uses this plugin will be using a theme they likely created or modified manually, so they could also just remove wp_head, but that's hardly a solution, is it?


  2. maerk
    Posted 9 years ago #

    Have you looked at PHP's output buffering functions?

    They basically let you catch what PHP would normally output to the browser and modify it. So, once the page is ready to be sent to the browser, it's caught for further processing and then outputted.


  3. TrevorBramble
    Posted 9 years ago #

    Good thinking! Thanks for the tip.

Topic Closed

This topic has been closed to new replies.

About this Topic