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
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.