BBP_Forums_Group_Extension::maybe_unset_forum_menu()

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


Description Description


Return Return

(If) not viewing a single group


Top ↑

Source Source

File: includes/extend/buddypress/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;
	}

Top ↑

Changelog Changelog

Changelog
Version Description
2.3.0 Introduced.

Top ↑

User Contributed Notes User Contributed Notes

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