AnsPress_BP_Hooks::content_setup_nav()

Description #

BuddyPress nav hook.

Source #

File: addons/free/buddypress.php

	public static function content_setup_nav() {
		global $bp;

		bp_core_new_nav_item( array(
				'name'                  => __( 'Q&A', 'anspress-question-answer' ),
				'slug'                  => 'qa',
				'screen_function'       => [ __CLASS__, '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 ) {
			SELF::setup_subnav( $nav['name'], $nav['slug'] );
		}
	}

Leave a Reply

Your email address will not be published.

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

Add your comment