WordPress API gives wrong post_author
-
I am facing a strange problem. I have a multi-author blog with thousands of posts by hundreds of users. I was trying to use WP API top-author GET request to fetch top authors. But to my surprise, I could not see author-wise stats through API or WordPress Stats dashboard. Though the posts have correct number of views and I can get top-posts via API as well as dashboard.
After checking I realized that the post_author data provided by WP API is wrong. It was a 7 digit numeral which was same for all the posts. I checked in my site database & by using get_post( $post_id )->post_author, the data was correct on my site.
That means somehow WordPress Stats could not sync the correct post_author to their backend. Then I checked for my other sites and I found the same number in post_author everywhere.
Is anybody else facing the same issue in their WP Dasbaord/WP API calls?
- The topic ‘WordPress API gives wrong post_author’ is closed to new replies.