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
/** | |
* Filter BuddyPress multi select value and add spans around for custom styling. | |
* | |
* @see https://buddydev.com/support/forums/topic/add-extra-css-on-a-profile-field/ | |
*/ | |
add_filter( 'bp_get_the_profile_field_value', function ( $value ) { | |
global $field; | |
if ( empty( $field ) || 'multiselectbox' !== $field->type ) { | |
return $value; | |
} |
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
/** | |
* Get time/count for the user | |
* | |
* @param int $user_id user id. | |
* | |
* @return array | |
*/ | |
function buddydev_get_activity_mtype_based_rates( $user_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 | |
/** | |
* BuddyPress - Members Profile Loop | |
* | |
* @package BuddyPress | |
* @subpackage bp-legacy | |
* @version 3.0.0 | |
*/ | |
/** This action is documented in bp-templates/bp-legacy/buddypress/members/single/profile/profile-wp.php */ |
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
/** | |
* Redirect after successful upload of profile photo on BuddyPress. | |
*/ | |
class BP_Profile_Photo_Successful_Upload_Redirection_Helper { | |
/** | |
* Singleton instance. | |
* | |
* @var BP_Profile_Photo_Successful_Upload_Redirection_Helper |
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
/** | |
* BuddyPress Moderation Tools:- White List users | |
* | |
* All contents from whitelisted users are disabled from reporting. | |
*/ | |
add_filter( 'bpmts_is_user_whitelisted', function ( $is, $user_id ) { | |
$white_listed_user_ids = [ 1, 2, 3 ];// add your own ids. | |
if ( in_array( $user_id, $white_listed_user_ids ) ) { |
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
//Do not notify for join group activity in BP Local group Activity notifier | |
function buddydev_do_not_notify_join_group_activity( $stop_notification, $activity ) { | |
if ( $activity->type == 'joined_group' ) { | |
$stop_notification = true; | |
} | |
return $stop_notification; | |
} | |
add_filter( 'bp_local_group_notifier_skip_notification', 'buddydev_do_not_notify_join_group_activity', 10, 2 ); |
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
//do not let the activity be posted by any means(do not allow from directory etc) | |
function bd_check_post_update() { | |
$item_id = 0; | |
$object = ''; | |
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
class BuddyDev_Profile_Field_Completion_Helper { | |
/** | |
* Which member type should be set? PLease change it. | |
* | |
* @var string | |
*/ | |
private $member_type = 'YOUR_MEMBER_TYPE'; // Please Change it. | |
/** |
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
INSERT INTO wp_bp_activity(user_id, component, type, action, content, primary_link, item_id, date_recorded ) select ID, 'members', 'last_activity', '', '', '', 0, NOW() FROM wp_users WHERE ID NOT IN (SELECT user_id FROM `wp_bp_activity` WHERE type="last_activity" ) |