Obtaining array item from WordPress revisions output

Question

I am having trouble retrieving an array item from WordPress revisions array. I have Googled and no answer I have come across has worked so far. What I am trying to do is create a list of all Authors who have done revisions of a post so I can display this in a dashboard. The rest I can complete just having issues getting the item from the array.

$arrayz =  '[0]=>
  object(WP_Post)#4970 (24) {
    ["ID"]=>
    int(224)
    ["post_author"]=>
    string(1) "1"
    ["post_date"]=>
    string(19) "2019-11-18 23:93:39"
    ["post_date_gmt"]=>
    string(19) "2019-11-18 23:13:39"
    ["post_content"]=>
    string(24) "New content added here"
        }';

echo '<pre>';
var_dump($arrayz);
echo '</pre>';
// Getting error here
echo $arrayz[0]["post_author"];
0
Sam 1 year 0 Answers 62 views 0

Leave an answer