[wp-trac] [WordPress Trac] #47096: get_post_type() in author.php return random post type

WordPress Trac noreply at wordpress.org
Thu May 2 12:45:00 UTC 2019


#47096: get_post_type() in author.php return random post type
-------------------------------+------------------------------
 Reporter:  wolly              |       Owner:  (none)
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Posts, Post Types  |     Version:
 Severity:  normal             |  Resolution:
 Keywords:                     |     Focuses:
-------------------------------+------------------------------

Comment (by swissspidy):

 `get_post_type()` returns the post type of the global `$post`, which can
 be a different post depending on where exactly on your page you are
 calling it and depending on what kind of posts the author has written.

 Not sure what else you would expect from that function on the author
 archive..?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/47096#comment:1>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list