BuddyPress::content_setup_nav()

Description #

BuddyPress nav hook.

Source #

File: addons/buddypress/buddypress.php

	public function content_setup_nav() {
		global $bp;

		bp_core_new_nav_item(
			array(
				'name'                => __( 'Q&A', 'anspress-question-answer' ),
				'slug'                => 'qa',
				'screen_function'     => [ $this, 'ap_qa_page' ],
				'position'            => 30, // weight on menu, change it to whatever you want.
				'default_subnav_slug' => 'questions',
			)
		);

		$subnav = array(
			[
				'name' => __( 'Questions', 'anspress-question-answer' ),
				'slug' => 'questions',
			],
			[
				'name' => __( 'Answers', 'anspress-question-answer' ),
				'slug' => 'answers',
			],
		);

		$subnav = apply_filters( 'ap_bp_nav', $subnav );
		foreach ( $subnav as $nav ) {
			$this->setup_subnav( $nav['name'], $nav['slug'] );
		}
	}

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment