Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to use array in function to get only value I want
    primarykey
    data
    text
    <p>I am trying to work this function in wordpress theme the way where I can get value only what I want and not all to gather. I am not much familiar with using array in function so I need you expert help to make it works and I would really appreciate that.</p> <p>Here is my code</p> <pre><code>function gallery_artist($arg=null, $arg2=null, $arg3=null){ global $png_gallery_meta; $png_gallery_meta-&gt;the_meta(); $gallery = get_post_meta(get_the_ID(), $png_gallery_meta-&gt;get_the_id(), TRUE); $gallery_value = $gallery['image_artist']; $artist_info = $gallery_value; $string = $artist_info; $artist = substr($string, 0, stripos($string, "/") ); // getting first name and last name from user id $author_first_name = get_userdata(basename($string))-&gt;first_name; $author_last_name = get_userdata(basename($string))-&gt;last_name; $author_full_name = $author_first_name . ' ' . $author_last_name; $user_id = '&lt;a href=" ' . get_author_posts_url(basename($string)) . ' " title="more submissions of ' . $author_first_name .' '. $author_last_name . ' " &gt;' . $artist . '&lt;/a&gt;'; $arg = $author_first_name; echo $arg; $arg2 = $author_last_name; echo $arg2; $arg3 = $user_id; echo $arg3; } </code></pre> <p>After than I want to use this function to get any value I want and not unnecessary to render all three to gather. Means if I want only first name than I pass value only for that and it will render only first name so on..</p> <p>Here how I want to use something. but you can suggest any code and type of function I have no issue.</p> <pre><code>&lt;?php call_user_func_array('gallery_artist', array('first_name','last_name','artist_id') ) ?&gt; </code></pre> <p>Big Big thanks to you all..</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload