bp_group_type_show_correct_current_menu()

Opens the groups tab while on group types add/edit page.

Description

Source

File: bp-groups/bp-groups-admin.php

function bp_group_type_show_correct_current_menu(){
	$screen = get_current_screen();
	if ( $screen->id == 'bp-group-type' || $screen->id == 'edit-bp-group-type' ) {
		?>
		<script>
			jQuery(document).ready(function($) {
				$('#toplevel_page_bp-groups').addClass('wp-has-current-submenu wp-menu-open menu-top menu-top-first').removeClass('wp-not-current-submenu');
				$('#toplevel_page_bp-groups > a').addClass('wp-has-current-submenu').removeClass('wp-not-current-submenu');
			});
		</script>
		<?php
	}
	if ( $screen->id == 'bp-group-type' ) {
		?>
		<script>
			jQuery(document).ready(function($) {
				$('li.wp-first-item').next().addClass('current');
			});
		</script>
		<?php
	}
	if ( $screen->id == 'edit-bp-group-type' ) {
		?>
		<script>
			jQuery(document).ready(function($) {
				$('li.wp-first-item').next().addClass('current');
			});
		</script>
		<?php
	}
}

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.