Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save geotsiokos/a8a4e7e305977344fc12211512c94908 to your computer and use it in GitHub Desktop.
Save geotsiokos/a8a4e7e305977344fc12211512c94908 to your computer and use it in GitHub Desktop.
function my_affiliates_permanent_my_users( $atts ){
$output = "";
if ( is_user_logged_in() ) {
$user = wp_get_current_user();
$args = array(
'meta_key' => Affiliates_Permanent::REFERRER,
'meta_value' => $user->ID
);
$users = get_users( $args );
if ( isset( $users ) && ( sizeof( $users ) > 0 ) ) {
$output .= '<ul>';
foreach ( $users as $us ) {
$output .= '<li>' . $us->user_login . '</li>';
}
$output .= '</ul>';
}
}
return $output;
}
add_shortcode( 'affiliates_permanent_my_users', 'my_affiliates_permanent_my_users' );
@geotsiokos
Copy link
Author

That's great, I'm glad you resolved this and added further features.
Good to know that my code is useful.

Cheers

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment