This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class BP_Loop_Filters { | |
| /** | |
| * Constructor | |
| */ | |
| public function __construct() { | |
| $this->setup_actions(); | |
| $this->setup_filters(); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // Add a "By ratings" option to the sorting dropdown menu | |
| function yzc_add_members_directory_ratings_filter() { | |
| echo '<option value="youzify_user_ratings_total">' . __( 'By ratings', 'youzer' ) . '</option>'; | |
| } | |
| add_action( 'bp_members_directory_order_options', 'yzc_add_members_directory_ratings_filter' ); | |
| // Modify the query to sort the members by the number of ratings in descending order | |
| function yzc_sort_members_youzify_user_ratings_total( $query ) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Youzify - Activity Posts & Comments Letters Restrictions | |
| */ | |
| add_action( 'bp_activity_before_save', 'yzc_letters_restrictions', 10 ); | |
| function yzc_letters_restrictions( $activity ) { | |
| $error_msg = 'Sorry, you have added too many letters.'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| function yzc_reorder_group_tabs() { | |
| global $bp; | |
| if ( isset( $bp->groups->current_group->slug ) && $bp->groups->current_group->slug == $bp->current_item ) { | |
| $bp->bp_options_nav[$bp->groups->current_group->slug]['forum']['position'] = 10; | |
| $bp->bp_options_nav[$bp->groups->current_group->slug]['home']['position'] = 20; | |
| $bp->bp_options_nav[$bp->groups->current_group->slug]['info']['position'] = 30; | |
| $bp->bp_options_nav[$bp->groups->current_group->slug]['members']['position'] = 40; | |
| $bp->bp_options_nav[$bp->groups->current_group->slug]['media']['position'] = 50; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_filter( 'youzify_profile_header_show_member_type_meta', '_return_false' ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * BuddyPress Sync Activities Favourite with Activities Reactions. | |
| * */ | |
| add_action( 'bp_init', function() { | |
| if ( ! function_exists( 'yzar_option' ) ) { | |
| return; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /* | |
| * BuddyPress - Update Members Status & Update Groups Cache | |
| */ | |
| function yzc_add_update_group_cache() { | |
| $members = get_users( 'fields=ID' ); | |
| foreach ( $members as $user_id ) { | |
| bp_update_user_last_activity( $user_id, bp_core_current_time() ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * BuddyPress - Hide Group Activities in Global Feed | |
| */ | |
| function yzc_hide_group_activity_args( $args ) { | |
| if ( ! bp_is_activity_directory() ) { | |
| return $args; | |
| } | |
| $args['filter_query'] = array( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Youzify Albums - Fix albums count | |
| **/ | |
| add_action( 'init', 'yzc_fix_youzify_albums_count', 10); | |
| function yzc_fix_youzify_albums_count( ) { |