bp_groups_admin_types_menu()

Create Groups submenu to manage BuddyPress types.


Source Source

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

function bp_groups_admin_types_menu() {
	if ( ! bp_is_root_blog() ) {
		return;
	}

	if ( bp_is_network_activated() && ! bp_is_multiblog_mode() && is_network_admin() ) {
		// Adds a 'bp-groups' submenu to go to the root blog Group types screen.
		$group_type_admin_url = add_query_arg( 'taxonomy', 'bp_group_type', get_admin_url( bp_get_root_blog_id(), 'edit-tags.php' ) );
		add_submenu_page(
			'bp-groups',
			__( 'Group Types', 'buddypress' ),
			__( 'Group Types', 'buddypress' ),
			'bp_moderate',
			esc_url( $group_type_admin_url )
		);
	} elseif ( ! is_network_admin() ) {
		if ( bp_is_network_activated() && ! bp_is_multiblog_mode() ) {
			// Adds a 'bp-groups' menu to the root blog menu.
			$redirect_hook = add_menu_page(
				_x( 'Groups', 'Admin Groups page title', 'buddypress' ),
				_x( 'Groups', 'Admin Groups menu', 'buddypress' ),
				'bp_moderate',
				'bp-groups',
				'__return_empty_string',
				'div'
			);

			add_action( "load-{$redirect_hook}", 'bp_group_site_admin_network_admin_redirect' );
		}

		// Add the submenu to manage Group Types.
		add_submenu_page(
			'bp-groups',
			__( 'Group Types', 'buddypress' ),
			__( 'Group Types', 'buddypress' ),
			'bp_moderate',
			basename( add_query_arg( 'taxonomy', 'bp_group_type', bp_get_admin_url( 'edit-tags.php' ) ) )
		);
	}
}


Top ↑

Changelog Changelog

Changelog
Version Description
7.0.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.