WordPress.org

Ready to get started?Download WordPress

Forums

Can I make source search/replaces before output? (1 post)

  1. wilsonf1
    Member
    Posted 5 months ago #

    I found this function which can replace text inside the content of your article before posting:

    function replace_content($content)
    {
    $content = str_replace('Company Name', '<span class="company">Company Name</span>',$content);
    return $content;
    }
    add_filter('the_content','replace_content');

    Is there anyway to search and replace text in the entire source code? I'd ideally like to make some changes to some url's in href parameters before outputting to the browser.

    Thanks!

Reply

You must log in to post.

About this Topic