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 | |
/** | |
* Create Custom Groups Tab | |
*/ | |
add_action( 'bp_actions', 'yzc_create_custom_group_tab' ); | |
function yzc_create_custom_group_tab() { |
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 | |
/** | |
* Show User Rank on Profile Header. | |
*/ | |
function yzc_add_user_rank_in_header() { | |
if ( function_exists( 'mycred_get_users_rank' ) ) { | |
// Get rank 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
<?php | |
add_filter('youzify_get_attachment_image_size', 'custom_youzify_get_attachment_image_size', 999, | |
2); | |
function custom_youzify_get_attachment_image_size($size, $element) { | |
if ($element == 'activity-avatar-image') { | |
$size = 'full'; | |
} | |
return $size; | |
} |
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 | |
/** | |
* Get The User Activities Number. | |
*/ | |
function yzc_get_user_activities_number( $number, $user_id, $type ) { | |
if ( $type == 'posts' ) { | |
global $bp,$wpdb; | |
$activity_count = $wpdb->get_var( "SELECT COUNT(*) FROM {$bp->activity->table_name} | |
WHERE component IN ( 'activity', 'groups' ) AND type != 'activity_comment' AND user_id = '$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 | |
/** | |
* Youzify - BuddyPress Notify Users on New Activities. | |
*/ | |
add_action( 'youzify_after_adding_wall_post', 'yzc_notify_users_on_activities', 999 ); | |
function yzc_notify_users_on_activities( $activity_id ) { | |
$subject = "New activity posted!"; | |
$message = 'New activity has been posted, please visit ' . bp_activity_get_permalink( $activity_id ); | |
// Get all users. |
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_set_default_privacy_in_dropdown() { ?> | |
<script type="text/javascript"> | |
jQuery( 'div.youzify-privacy-tool option[value="members"]' ).attr( 'selected', true ); | |
</script> | |
<?php | |
} | |
add_action( 'wp_footer', 'yzc_set_default_privacy_in_dropdown' ); |
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 _yz_verified_users_shortcode( $atts = null ) { | |
// Get Args. | |
$args = shortcode_atts( | |
array( | |
'limit' => 5, | |
'order_by' => 'user_id', | |
'verified' => true, | |
), $atts, 'youzify_verified_users' ); |
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 - Youzify Exclude Multiple Roles from Members Directory | |
function yzc_exclude_users( $args ) { | |
$excluded = isset( $args['exclude'] )? $args['exclude'] : array(); | |
if( !is_array( $excluded ) ) { | |
$excluded = explode(',', $excluded ); | |
} | |
$user_roles = array( 'administrator', 'subscriber' ); | |
$users = get_users( array( 'role__in' => $user_roles, 'fields' => array( 'ID' ) ) ); | |
$users_ids = wp_list_pluck( $users, '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 | |
// Youzify - Make Image Thumbnail on Post Tab Clickable | |
function yzc_blog_post_thumbnail(){ | |
?> | |
<script> | |
jQuery(document).ready(function(){ | |
jQuery(document).delegate(".youzify-posts .youzify-tab-post div:first-child","click",function(){ | |
var link = jQuery(this).next().find('.youzify-post-title a').attr("href"); | |
if(link){ | |
window.location.href = link; |
NewerOlder