Replacing plugin templates with your own

You are here:
< All Topics
add_filter( 'bp_better_messages_current_template', 'overwrite_bp_better_messages_template', 10, 2 );

function overwrite_bp_better_messages_template( $path_to_template, $template ){

    if( $template === 'layout-index.php' ) {
        $template_path = get_template_directory() . '/bp-better-messages/layout-index.php';
    }

    return $template_path;
}
Previous Open Mini Chats programmatically (WebSocket Version)
Table of Contents