'Wordpress loop including function help (Profile Builder user listing)
I'm using a snippet provided on the bottom of this page.
I am looking to use this function in a shortcode on the Single user-listing template, which shows custom posts from that user listing user.
Can anyone help with how I would get the User ID outputted by that wppbc_get_user_email_cf7 function in the loop array? Marked with XXX.
function wppbc_get_user_email_cf7($atts){
$get_user_by_id = apply_filters('wppb_userlisting_get_user_by_id', true);
if ($get_user_by_id)
$user = get_user_by('ID', get_query_var('username'));
else {
$user = get_user_by('login', get_query_var('username'));
}
if ($user === false)
return;
else
return $user->ID; }
Loop array:
$args = array(
'numberposts' => -1,
'post_type' => 'records',
'meta_key' => 'client',
'meta_value' => XXX
);
I have already tried:
'meta_value' => wppbc_get_user_email_cf7()
Thanks
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
