Getting: Warning Missing argument 2 for bp_modify_page_title on tabs of site

The following warning appears in open tabs on my site bcosc.com. This is from the home page tab

<br/> <b>Warning</b>: Missing argument 2 for bp_modify_page_title() in
<b>/home1/bcosc/public_html/wp-content/plugins/buddypress/bp-core/bp0core-filters.php</b> on line <b>393</b><br/><br/><br/> <b>Warning</b>: Missing argument 3 for bp_modify_page_title() in
<b>/home1/bcosc/public_html/wp-content/plugins/buddypress/bp-core/bp0core-filters.php</b> on line <b>393</b><br/><br/>BCoSC|

Did I miss something in the bp setup?

  • Andrea
    • New Recruit

    I believe this is the part of the code that is giving me the error but I'm not sure what is wrong.

    */
    function bp_modify_page_title( $title, $sep, $seplocation ) {
            global $bp;
    
            // If this is not a BP page, just return the title produced by WP
            if ( bp_is_blog_page() )
                    return $title;
    
            // If this is a 404, let WordPress handle it
            if ( is_404() ) {
                    return $title;
            }
    
            // If this is the front page of the site, return WP's title
            if ( is_front_page() || is_home() )
                    return $title;
    
            $title = '';
    
            // Displayed user
            if ( bp_get_displayed_user_fullname() && !is_404() ) {
    
                    // Get the component's ID to try and get it's name
                    $component_id = $component_name = bp_current_component();
    
                    // Use the actual component name
                    if ( !empty( $bp->{$component_id}->name ) ) {
                            $component_name = $bp->{$component_id}->name;
    
                    // Fall back on the component ID (probably same as current_component)
                    } elseif ( !empty( $bp->{$component_id}->id ) ) {
                            $component_name = $bp->{$component_id}->id;
                    }
    
                    // Construct the page title. 1 = user name, 2 = seperator, 3 = component name
                    $title = strip_tags( sprintf( _x( '%1$s %3$s %2$s', 'Construct the page title. 1 = user name, 2 = component name, 3 = seperator', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ), $sep ) );
    
            // A single group
            } elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {
                    $subnav = isset( $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] ) ? $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] : '';
                    // translators: "group name | group nav section name"
                    $title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->bp_options_title, $subnav );
    
            // A single item from a component other than groups
            } elseif ( bp_is_single_item() ) {
                    // translators: "component item name | component nav section name | root component name"
                    $title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[bp_current_item()][bp_current_action()]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );
    
            // An index or directory
            } elseif ( bp_is_directory() ) {
    
                    $current_component = bp_current_component();
    
                    // No current component (when does this happen?)
                    if ( empty( $current_component ) ) {
                            $title = _x( 'Directory', 'component directory title', 'buddypress' );
                    } else {
                            $title = bp_get_directory_title( $current_component );
                    }
    
            // Sign up page
            } elseif ( bp_is_register_page() ) {
                    $title = __( 'Create an Account', 'buddypress' );
    
            // Activation page
            } elseif ( bp_is_activation_page() ) {
                    $title = __( 'Activate your Account', 'buddypress' );
    
            // Group creation page
            } elseif ( bp_is_group_create() ) {
                    $title = __( 'Create a Group', 'buddypress' );
    
            // Blog creation page
            } elseif ( bp_is_create_blog() ) {
                    $title = __( 'Create a Site', 'buddypress' );
            }
    
            // Some BP nav items contain item counts. Remove them
            $title = preg_replace( '|<span>[0-9]+</span>|', '', $title );
    
            return apply_filters( 'bp_modify_page_title', $title . ' ' . $sep . ' ', $title, $sep, $seplocation );
    }
    add_filter( 'wp_title', 'bp_modify_page_title', 10, 3 );
    add_filter( 'bp_modify_page_title', 'wptexturize'     );
    add_filter( 'bp_modify_page_title', 'convert_chars'   );
    add_filter( 'bp_modify_page_title', 'esc_html'        );
    
    /**
  • Andrea
    • New Recruit

    Worked perfect!
    I replaced
    <title><?php elegant_titles(); ?></title>
    with
    <title><?php wp_title(); ?></title>
    in the header php just as suggested
    Thank you!

    I'll put a post on the ET and perhaps they can find a permanent fix

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.