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 ) { |
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 ) { |
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( '/' ) ) ); | |
} |
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 user to some page on site when automatically activated and logged in. | |
* | |
* @param string $url url to redirect to. | |
* @param int $user_id user id. | |
* | |
* @return string | |
*/ | |
function buddydev_custom_activation_redirect( $url, $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 | |
// your php custom code goes below this line. |
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 block/unblock button on single message thread. | |
*/ | |
function buddydev_show_user_report_button_on_message_thread() { | |
// only message involving single user can be blocked. | |
if ( ! function_exists( 'bpmts_report_button' ) || ! bp_is_my_profile() ) { | |
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
/** | |
* Get the applicable limit for the given role. | |
* | |
* @param string $role role name. | |
* | |
* @return array | |
*/ | |
function buddydev_custom_get_role_based_message_limit( $role ) { |
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 BP_Other_User_As_Profile_Field { | |
/** | |
* Field id, replace with actual field id. | |
* | |
* @var string | |
*/ | |
private $field_id = 25; // Chang it with actual field 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
/** | |
* Class BP_Featured_Member_Expirable_Membership | |
* | |
* @author Ravi Sharma | |
*/ | |
class BP_Featured_Member_Expirable_Membership{ | |
/** | |
* Singleton Instance |
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
/** | |
* Auto join user to current group when using BuddyPress Ajax Registration plugin. | |
* | |
* @param int $user_id user id. | |
*/ | |
function buddydev_auto_join_current_group_on_activation( $user_id ) { | |
if ( bp_is_group() ) { | |
groups_join_group( groups_get_current_group()->id, $user_id ); |