I am utilizing array_map to kind out an array with all of my _octopud_id’s.
var_dump($workplaces)
: Returns the next:
array (dimension=500)
0 =>
array (dimension=1)
'id' => string '1382' (size=4)
1 =>
array (dimension=1)
'id' => string '1330' (size=4)
I have to enter that array integer into the ‘workers/’ part however I can not work out how – If I hardcode workers/6
I get the next consequence:
object(stdClass)[14592]
public 'id' => int 6
What may I be doing fallacious? I hold getting the Discover: Array to string conversion
error on the $outcomes = line.
/* Return an array of _octopus_ids */
$workplaces = array_map(
operate($submit) {
return array(
'id' => get_post_meta($post->ID, '_octopus_id', true),
);
},
$query->posts
);
var_dump($workplaces);
$outcomes = $octopus->get_all('worker/' . implode($workplaces));
var_dump($outcomes);