Answer the question
In order to leave comments, you need to log in
How to get strings from an array in PHP via WP-JSON?
Hello! Wordpress Rest API comes with such an array, how to get specific values of all 'guid' values from this array? PHP uses the following code
register_rest_field( 'post', 'AttachedImages', array(
'get_callback' => function ( $data ) {
$postID = $data['id'];
$attached_file = get_attached_media('',$postID);
return $attached_file;
}, ));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question