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'] ); } }
Expand full source code Collapse full source code View on GitHub: addons/free/buddypress.php:95
Add your comment