BP_REST_Media_Details_Endpoint::get_media_tabs()
Get Media Directory tabs.
Description
Return
(array)
Source
File: bp-media/classes/class-bp-rest-media-details-endpoint.php
161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 | public function get_media_tabs() { $tabs = array (); add_filter( 'bp_get_total_media_count' , array ( $this , 'bp_rest_get_total_media_count' ) ); $tabs_items = function_exists( 'bp_nouveau_get_media_directory_nav_items' ) ? bp_nouveau_get_media_directory_nav_items() : array (); remove_filter( 'bp_get_total_media_count' , array ( $this , 'bp_rest_get_total_media_count' ) ); if ( ! empty ( $tabs_items ) ) { foreach ( $tabs_items as $key => $item ) { $tabs [ $key ][ 'title' ] = $item [ 'text' ]; $tabs [ $key ][ 'count' ] = $item [ 'count' ]; $tabs [ $key ][ 'position' ] = $item [ 'position' ]; } } return $tabs ; } |
Changelog
Version | Description |
---|---|
0.1.0 | Introduced. |
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.