Jump to content

TiagoSilva

New Members
  • Content Count

    6
  • Joined

  • Last visited

Community Reputation

0 Neutral

About TiagoSilva

  • Rank
    Newbie
  1. Hey Guys, Can someone give a little help? I found that it returns 2 arrays. For example Array ( [0] => 3 ) Array ( [0] => 1 ) ....thats why the substr() is not working. Because if I tried to get the first element it would give me "31". And the second element would be "empty". <?php $userlist = get_users_who_favorited_post($post_id = null, $site_id = null); foreach ($userlist as $user) { $int= "{$user->data->ID}"; // 31 (not a sequence like I thought) $arr1 = str_split($int); print_r($arr1); //Array ( [0] => 3 ) Array ( [0] => 1 ) } ?> I want to obtain the f
  2. Hello, I tried with substr ...but no success until now.. <?php $userlist = get_users_who_favorited_post($post_id = null, $site_id = null); foreach ($userlist as $user) { $int="{$user->data->ID}"; //returns 1234 (Example) } echo substr($int, 1, 1); ?> its not working. is there an alternative to substr?? any sugestions? Thanks,
  3. Hello, You did it! =) <?php $userlist = get_users_who_favorited_post($post_id = null, $site_id = null); foreach ($userlist as $user) { echo "{$user->data->ID}"; } ?> Another question. I want to echo only the first ID number .....or only que second ID number ....how can I do that?
  4. Hello, Thanks for the help. So it starts like this: <?php $userlist = get_users_who_favorited_post($post_id = null, $site_id = null); <--- gives the array above what should I type here? print_r($userlist) ?> And I want a formula to get only ID´s .....and another formula to obtain only emails... Thanks
  5. Hey guys, Ive spent weeks trying to filter this array. Can someone help me? I want to filter and display only user ID´s or only emails. How do I do that? Array ( [2] => WP_User Object ( [data] => stdClass Object ( [iD] => 3 [user_login] => test [user_pass] => $P$FSBSFByN.kDA20C2B1HLYtossdD1 [user_nicename] => test [user_email] => noreply1@test.com [user_url] => [user_registered] => 2016-06-28 06:41:10 [user_activation_key] => [user_status] => 0 [display_name] => Albert Einstein ) [iD] => 3 [caps] => Array ( [subscriber] => 1 ) [cap_key] => w
  6. Hello, I need a little help, I would greatly appreciate if someone helped me with this. I have 3 functions, and I want to make them work the following way: Function 1: This function gives me a list of users who liked a blog post. It gives me an HTML list. I want a formula which filters the output giving me ONLY the first value of the list. Or only the second value. Or only the third value. the_users_who_favorited_post($post_id = null, $site_id = null, $separator = 'list', $include_anonymous = true, $anonymous_label = 'Anonymous Users', $anonymous_label_single = 'Ano
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.