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

WordPress Trac noreply at wordpress.org
Thu May 2 14:41:57 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 wolly):

 In the sidebar I have a function that check what cpt is.

 Based on that check, I add action or not.

 I solved using ! is_author, but, probably is my mistake, I thought that in
 author php I had non CPT value.

 You are sayng that it take the cpt value of the post in the loop, in this
 case, the first one, since the loop is of mixed post type.

 If this is the expected result, it's not a bug :-)

 Thanx a lot for your time

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


More information about the wp-trac mailing list