WordPress.org

Ready to get started?Download WordPress

Forums

Filtering wp_head output (3 posts)

  1. TrevorBramble
    Member
    Posted 7 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?

    Cheers,
    Trevor

  2. maerk
    Member
    Posted 7 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.

    http://uk.php.net/manual/en/ref.outcontrol.php

  3. TrevorBramble
    Member
    Posted 7 years ago #

    Good thinking! Thanks for the tip.

Topic Closed

This topic has been closed to new replies.

About this Topic