widget spitting out values as arrays instead of single items
-
Hi,
I’m building my first widget for my husband’s record label. I’m getting information from two custom fields and using it to display some flash widgets from Reverb Nation.The custom fields are artist ID and media type. There is only a single instance of each on each post.
For some reason my widget is returning the values from the widget control panel as arrays rather than single values. I can get the widget to ‘work’ if I use get_post_custom_values and then do a foreach to split out the array. However this spits me all sorts of errors when error testing is on.
How do I get the widget to return single values, so that I can use get_post_meta. (like where I’m trying to set a value for $newlink and $newreverb.
This is the first widget I’ve written and the first PHP I’ve touched in about 6 years.
This is the code
[Code moderated as per the Forum Rules. Please use the pastebin]Thanks Community
- The topic ‘widget spitting out values as arrays instead of single items’ is closed to new replies.