This file contains 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 - BuddyPress Automatically add new users to a group after a complete payment | |
*/ | |
add_action( 'woocommerce_payment_complete', 'yzc_auto_join_groups_on_payment' ); | |
function yzc_auto_join_groups_on_payment( $order_id ) { | |
// Get data. | |
$order = wc_get_order( $order_id ); |
This file contains 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 | |
/** | |
* Redirect Custom Tab | |
**/ | |
function yzc_redirect_tab() { | |
if ( ! is_user_logged_in() || bp_current_component() != 'visitors' ) { | |
return; | |
} |
This file contains 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 - Hide BuddyPress Members Directory Default Meta | |
function yzc_hide_md_cards_meta() { | |
return ''; | |
} | |
add_filter( 'youzify_members_directory_user_default_meta', 'yzc_hide_md_cards_meta' ); |
This file contains 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 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 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 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 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 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; | |
} |