WordPress convertit objet en tableau
<?php
/*
* Convert Object To Array
*/
$args = array(
'showposts' => -1,
'post_type' => 'post',
'post_status' => 'publish'
);
$result = new WP_Query($args);
$data = array_map(
function( $post ) {
return (array) $post;
},
$result->posts
);
Adventurous Ant