BP_REST_Groups_Details_Endpoint::get_groups_tabs( WP_REST_Request $request )

Get Groups tabs.

Description

Parameters

$request

(Required) The request sent to the API.

Return

(array)

Source

File: bp-groups/classes/class-bp-rest-groups-details-endpoint.php

	public function get_groups_tabs( $request ) {
		$type = $request->get_param( 'type' );
		$tabs = array();

		$tabs_items = bp_nouveau_get_groups_directory_nav_items();

		if ( ! empty( $tabs_items ) ) {
			foreach ( $tabs_items as $key => $item ) {
				$tabs[ $key ]['title']    = $item['text'];
				$tabs[ $key ]['position'] = $item['position'];
				$tabs[ $key ]['count']    = $this->get_group_tab_count( $item['slug'], $type );
			}
		}

		return $tabs;
	}

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.