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 | |
/** | |
* 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; |
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('bp_activity_time_since', 'bp_activity_time_since_newformat', 10, 2); | |
function bp_activity_time_since_newformat( $time_since, &$actvitiy ) { | |
// you can change the date format to "Y-m-d H:i:s" | |
$time_since = '<span class="time-since">' . date_i18n("Y-m-d H:i", strtotime( $actvitiy->date_recorded ) ) . '</span>'; | |
return $time_since; | |
} | |
add_filter('bp_activity_comment_date_recorded', 'bp_activity_comment_date_recorded_newformat', 10, 2); | |
function bp_activity_comment_date_recorded_newformat( $date_recorded ) { | |
global $activities_template; |
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 - Disable WooCommerce Checkout Integration | |
add_filter( 'youzify_supported_wc_pages', 'yzc_supported_wc_pages' ); | |
function yzc_supported_wc_pages( $pages ) { | |
unset( $pages['checkout'] ); | |
return $pages; | |
} |
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 Comment Media to Activity Media Widget and Tab | |
add_filter( 'youzify_get_media_activity_types', 'yzc_add_activity_comment_to_media', 10, 2 ); | |
function yzc_add_activity_comment_to_media( $activity_sql, $type ) { | |
$activity_sql .= ",'activity_comment'"; | |
return $activity_sql; | |
} |
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_get_linked_member_types_and_user_roles_2() { | |
// Set Member Type Name => User Role | |
return array( | |
'teacher' => 'subscriber', | |
'type2' => 'editor' | |
); |
NewerOlder