[wp-trac] [WordPress Trac] #18785: Modernize screen functions

WordPress Trac wp-trac at lists.automattic.com
Thu Dec 1 07:37:02 UTC 2011


#18785: Modernize screen functions
----------------------------+---------------------
 Reporter:  nacin           |       Owner:  nacin
     Type:  task (blessed)  |      Status:  closed
 Priority:  normal          |   Milestone:  3.3
Component:  Administration  |     Version:  3.3
 Severity:  normal          |  Resolution:  fixed
 Keywords:  dev-feedback    |
----------------------------+---------------------

Comment (by mikeschinkel):

 Replying to [comment:152 nacin]:
 > Since $current_screen is an object, making it an action doesn't prevent
 modifications to it. But it does make plugin authors think twice about
 using this to modify the object directly.

 Can you speak directly to this? Are you saying that plugins should not add
 properties to the `$current_screen` object, and if not, why not?

 One of my projects, which includes code planned to be released for others
 to use, is a `$context` object which I started developing before you added
 `$current_screen` to WordPress core. I've been planning to consolidate the
 properties of my `$context` object into `$current_screen` once v3.3
 releases.

 Are you saying we should not modify `$current_screen`?  If we should not
 add properties to it, why not, and why would it be better to force
 developers to look elsewhere for the current context added by a plugin?
 Also, `$current_screen` is missing context items which are often needed
 such as `$current_screen->post_id` ''(where applicable, of course)'' so it
 makes sense for plugins to add those if they are not already set so the
 plugin can depend on them being there.

 Or am I just misunderstanding your comment above?

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/18785#comment:153>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list