BBP_Forums_Group_Extension::maybe_unset_forum_menu()

Maybe unset the group forum nav item if group does not have a forum

Description

Return

(If) not viewing a single group

Source

File: bp-forums/groups.php

	public function maybe_unset_forum_menu() {

		// Bail if not viewing a single group
		if ( ! bp_is_group() )
			return;

		// Are forums enabled for this group?
		$checked = bp_get_new_group_enable_forum() || groups_get_groupmeta( bp_get_new_group_id(), 'forum_id' );

		// Tweak the nav item variable based on if group has forum or not
		$this->enable_nav_item = (bool) $checked;
	}

Changelog

Changelog
Version Description
bbPress (r4552) 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.