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 | |
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 | |
// Remove Wild Activity Filter Bar | |
function yzc_remove_wild_activity_nav() { | |
remove_action( 'youzify_profile_main_content', 'youzify_profile_activity_tab_filter_bar' ); | |
} | |
add_action( 'init', 'yzc_remove_wild_activity_nav'); | |
// Add Filter Bar Inside Content Main Content Area |
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 | |
/** | |
* Include Non Active Users In Members Total Count. | |
*/ | |
function yzc_include_non_active_members_in_total_members_count( $count ) { | |
$count = count_users(); | |
return $count['total_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 | |
// Enable Page Login Popup | |
function yzc_add_login_page_attribute( $atts, $item, $args ) { | |
if ( is_user_logged_in() ) { | |
return $atts; | |
} | |
// Get Login Page ID. | |
$login_page_id = 1212; |
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 the Job Listing Activity support! | |
*/ | |
add_post_type_support( 'job_listing', 'buddypress-activity' ); | |
/** | |
* Track New Job Listing Posts. | |
*/ |
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 | |
/** | |
* Redirect Members Directory To Login Page For Non Logged in Users. | |
*/ | |
function yzc_redirect_members_directory_to_login_page() { | |
if ( ! is_user_logged_in() && bp_is_members_directory() ) { | |
$redirect_url = yz_get_login_page_url(); | |
wp_redirect( $redirect_url ); | |
exit(); |
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 | |
/** | |
* Edit Basic Info Widget Value. | |
*/ | |
function yzc_edit_basic_info_value( $value, $data ) { | |
switch ( $data['id'] ) { | |
case 'email_address': | |
return '<a href="mailto:' . $value . '">' . $value. '</a>'; |