WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] wp_title filter help (2 posts)

  1. blasher
    Member
    Posted 3 years ago #

    any idea as to why a filter would never get executed. i've got an issue where i'm trying to set <title></title> for BP forums pages. i copied some code from the BP.org that looks something like the following:

    /* add page title to buddypress forum pages */

    echo '<script type="text/javascript">alert("here1")</script>';
    function my_page_title( $title, $b )
    { global $bp;

    echo '<script type="text/javascript">alert("here2")</script>';

    if ( bp_is_group_forum_topic() ) {
    $topic_title = bp_get_the_topic_title();
    $title .= ' | ' . $topic_title;
    }

    return $title;
    }

    add_filter( 'bp_page_title', 'my_page_title', 10, 2);
    echo '<script type="text/javascript">alert("here3")</script>';

    but that didn't seem to work (the alert1 and alert3 execute, but i never see the alert2). i tried changing the filter from bp_page_title to wp_title thinking maybe it was an incorectly specified filter in BP, but that didn't seem to make a difference.

    any ideas?

  2. blasher
    Member
    Posted 3 years ago #

    never mind. it works, but only for non-BP-generated pages. i don't understand why, but that's what's happenning.

Topic Closed

This topic has been closed to new replies.

About this Topic