WordPress.org

Ready to get started?Download WordPress

Forums

wp_title filter problem (5 posts)

  1. Ivan M
    Member
    Posted 11 months ago #

    Hello,

    I need to change wp title with plugin, but I have problem with using wp_title filter in WPMU installation.

    I have this simple code:

    function my_title_filter($oldtitle) {
        return "added by plugin | $oldtitle";
    }
    add_filter('wp_title', 'my_title_filter', 500);

    This code works perfect in normal WP installation, but not in WPMU.
    Is there some differences between WPMU and standard WP installation? Maybe I should use some other filter in WPMU for the same thing?

  2. Where'd you put the code? Is this in a plugin that's active on the site?

  3. Ivan M
    Member
    Posted 11 months ago #

    Yeah, code is in plugin, and plugin is active on the site. The same code works fine in normal (single) wordpress installation.

  4. I just tested this on a clean Multisite. Put the code in a plugin file, activated it on the site, and all the post titles get 'added by plugin' put in front, no problems.

    Try turning on WP_DEBUG

  5. Ivan M
    Member
    Posted 10 months ago #

    Thanks for info. I probably have conflict with some other plugin, or even maybe plugin for caching. I'll try turn on wp_debug, and find the problem.

Reply

You must log in to post.

About this Topic