Created
February 29, 2024 10:26
-
-
Save KaineLabs/8717565a2586a9b4e8b1ccae1aa686b2 to your computer and use it in GitHub Desktop.
BuddyPress - Youzify Show Only Verified Members Shortcode: [yz_verified_users limit="5"]
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' ); | |
// Get Users List. | |
$verified_users = youzify_get_verified_users( $args ); | |
if( !empty($verified_users) ){ | |
foreach ($verified_users as $value) { | |
$result .= $value . ','; | |
} | |
$user_ids = rtrim($result,','); | |
echo do_shortcode('[youzify_members max="' . $args['limit'] .'" include ="' . $user_ids .'"]'); | |
} | |
} | |
add_shortcode('yz_verified_users', '_yz_verified_users_shortcode') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment