i.e [test somevalues=1,2,3,4,5]
First time poster and alsoa php newb, I’m trying to add a feature to a plugin but I seem to keep triggering a debug notice from wordpress.
$ somearray = shortcode_atts([ 'somevalues' => null, ], $ atts); $ somearray['somevalues'] = array_map( 'trim', str_getcsv( $ somearray['somevalues'], ',' ) );
The above does work, but it results in a debug Notice: wpdb::prepare was called incorrectly.
Is there a way to achieve the same without triggering the notice? It doesn’t have to be csv, I just need it to return a string of somevalues, rather than returning an int. I guess what I want it to act like is as if it was written like [test somevalues=one,two,three,four,five]
Any suggestions on how to get around this? Many thanks