bp_nouveau_get_component_filters( string $context = '', string $component = '' )
Get Dropdawn filters for the current component of the one passed in params
Description
Parameters
- $context
-
(Optional) 'directory', 'user' or 'group'
Default value: ''
- $component
-
(Optional) The BuddyPress component ID
Default value: ''
Return
(array) the dropdown filters
Source
File: bp-templates/bp-nouveau/includes/functions.php
461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 | function bp_nouveau_get_component_filters( $context = '' , $component = '' ) { $filters = array (); if ( empty ( $context ) ) { if ( bp_is_user() ) { $context = 'user' ; } elseif ( bp_is_group() ) { $context = 'group' ; // Defaults to directory } else { $context = 'directory' ; } } if ( empty ( $component ) ) { if ( 'directory' === $context || 'user' === $context ) { $component = bp_current_component(); if ( 'friends' === $component ) { $context = 'friends' ; $component = 'members' ; } } elseif ( 'group' === $context && bp_is_group_activity() ) { $component = 'activity' ; } elseif ( 'group' === $context && bp_is_group_members() ) { $component = 'members' ; } } if ( ! bp_is_active( $component ) ) { return $filters ; } if ( 'members' === $component ) { $filters = bp_nouveau_get_members_filters( $context ); } elseif ( 'activity' === $component ) { $filters = bp_nouveau_get_activity_filters(); // Specific case for the activity dropdown $filters = array_merge ( array ( '-1' => __( '- View All -' , 'buddyboss' ) ), $filters ); } elseif ( 'groups' === $component ) { $filters = bp_nouveau_get_groups_filters( $context ); } elseif ( 'blogs' === $component ) { $filters = bp_nouveau_get_blogs_filters( $context ); } return $filters ; } |
Changelog
Version | Description |
---|---|
BuddyPress 3.0.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.