bp_forums_highlight_forums_new_submenu( $submenu_file )

Make submenu highlight when on editing/creating topic

Description

Source

File: bp-forums/admin.php

126
127
128
129
130
131
132
133
134
135
136
137
function bp_forums_highlight_forums_new_submenu( $submenu_file ) {
    global $pagenow;
 
    $post_type = isset( $_GET['post_type'] )? $_GET['post_type'] : '';
    $forums_post_types = [ bbp_get_forum_post_type(), bbp_get_topic_post_type(), bbp_get_reply_post_type() ];
 
    if ( $pagenow && 'post-new.php' == $pagenow && in_array( $post_type, $forums_post_types ) ) {
        return 'edit.php?post_type=' . $post_type;
    }
 
    return $submenu_file;
}

Changelog

Changelog
Version Description
BuddyBoss 1.0.0 Introduced.

Questions?

We're always happy to help with code or other questions you might have! Search our developer docs, contact support, or connect with our sales team.