[wp-trac] [WordPress Trac] #14886: current_screen object lies because of unspecified post_type parameter

WordPress Trac wp-trac at lists.automattic.com
Sun Sep 26 18:01:50 UTC 2010

#14886: current_screen object lies because of unspecified post_type parameter
 Reporter:  nacin         |       Owner:     
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  3.1
Component:  Post Types    |     Version:     
 Severity:  normal        |    Keywords:     

Comment(by mikeschinkel):

 Replying to [comment:4 nacin]:
 > I think we need to be more explicit in how this object's properties get
 set, and prevent the need for it to be manipulated later with more
 accurate information.

 A big +1.

 > The object on edit-tags.php provides no information about the parent
 screen. Specifically, the value of $typenow. But if $typenow isn't set it
 should default to 'post' on screens where that is indeed valid. For
 example, edit-tags.php?taxnomy=post_tag where post_type is omitted. This
 also makes it pretty much impossible to check $typenow unless of course
 you know the default. While the default isn't going to change, it also
 isn't intuitive.

 I think pages like edit-tags.php should set $typenow to a known ''"not
 applicable"'' value.  If we can trust '''`null`''' to always be set when
 not applicable then maybe `null` otherwise maybe something like `n/a`.
 It's important to be able to know that there is no post so that code that
 requires a post ''should not run'' on those pages.


Ticket URL: <http://core.trac.wordpress.org/ticket/14886#comment:6>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software

More information about the wp-trac mailing list