View buddypress-xprofile-field-sum.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
/** | |
* Shortcode to sum all the values of the given xprofile field. | |
* | |
* @param int|string $field field id or name. | |
* | |
* Example 1:- Total Cows owned by our members [xprofile-field-sum field="Number of Cows you Own"] | |
* Example 2:- Total Cows owned by our members [xprofile-field-sum field=32] | |
*/ | |
add_shortcode( 'xprofile-field-sum', function ( $atts = array(), $content = '' ) { |
View same-gender-user-visibility-buddypress.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
<?php | |
/** | |
* Filters Users based on Gender. Make sure only users of same genders are visible. | |
*/ | |
class BuddyDev_Same_Gender_Based_Member_Filter { | |
/** | |
* Boot | |
* | |
* @return BuddyDev_Same_Gender_Based_Member_Filter |
View buddypress-filter-multi-select-profile-field-value.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
/** | |
* 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; | |
} |
View member-type-activity-rate-limit.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
/** | |
* Get time/count for the user | |
* | |
* @param int $user_id user id. | |
* | |
* @return array | |
*/ | |
function buddydev_get_activity_mtype_based_rates( $user_id ) { |
View profile-loop.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
<?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 */ |
View bp-profile-photo-successful-upload-redirection-helper.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 |
View buddypress-moderation-tools-white-list-users.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
/** | |
* 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 ) ) { |
View Recount all members to account excluded member types
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
add_filter( 'bp_core_get_active_member_count', function ( $count ) { | |
// protect from errro if plugin is disabled. | |
if ( ! class_exists( 'BPMTP_Member_Types_Pro' ) ) { | |
return $count; | |
} | |
// optimize. | |
$current_count = get_transient( 'bpmtp_all_active_members' ); | |
if ( false !== $current_count ) { |
View show media with MediaPress activity comments
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
/** | |
* Attach media with comments on a mediapress activity. | |
* | |
* @param int $comment_id comment id. | |
* @param array $r args. | |
* @param BP_Activity_Activity $activity activity object. | |
*/ | |
function mpp_custom_comment_posted( $comment_id, $r, $activity ) { |
View bp-user-redirect.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 users to login if not not logged, otherwise, redirect to user activity. | |
*/ | |
function buddydev_custom_user_home_page() { | |
if ( ! is_user_logged_in() ) { | |
bp_core_redirect( wp_login_url( site_url( '/' ) ) ); | |
} |
NewerOlder