0
votes
0answers
562 views

Update Post Meta for Arrays — Remove/Replace Single Value from Multi Dimensional Array

I am trying to unset/remove then replace/update a single value from a post meta field, but my code for array_push() and unset() are removing all of the values from each array. Here are the two halves ...
0
votes
1answer
114 views

Random element in get_post_meta array

I have a custom field that contains a list of comma separated colors. I want to randomly select one of those colors. If get_post_meta returns an array I thought I could randomly pick from that ...
0
votes
0answers
22 views

How do I retrieve a value from a multi - dimensional array using get_post_meta? [duplicate]

I know that I need to use get_post_meta(31, $custom_repeatable, true); The post_id is 31 and the meta_value is $custom_repeatable. I would like to display the value hamsters repeat one only . My ...
-1
votes
1answer
151 views

How do I just display the part of the array that I want to? [closed]

I would like to take a stored array, from the meta_value $custom_repeatable and just display the line 'hamsters repeat one', but the following code doesn't display it how I'd like. Here is the code: ...
-2
votes
1answer
756 views

echo is just displaying the word 'array', rather than the array [closed]

I'm trying to see the structure of an array, but when I try to echo the array, all it says is 'array'. Please can someone explain how I can see the structure of an array? add_shortcode('book', ...
0
votes
1answer
275 views

Run a check for multiple meta key values

I am having a heck of a time getting wordpress to display all values of a certain meta key correctly. I wonder if I am going about this the wrong way? My end goal is to run a check to see if there ...
0
votes
1answer
3k views

Retrieving multiple values to the Post Meta (using an array)

I'm having a problem retrieving post_meta values that I have stored in an array. I use this for storing the array: add_action( 'comment_post', 'add_food', 1 ); function add_food(){ global $post; ...
0
votes
2answers
627 views

Echo 2 values from one key in Array with get_post_custom

Edit 12/15/2011 Added Radio Button print code // Add meta boxes to admin panel only needs to be added once add_action('admin_menu', 'plib_add_box'); //Add meta boxes to post types ...