[wp-trac] [WordPress Trac] #14083: Specific action hooks for different content types on load of the edit screen

WordPress Trac wp-trac at lists.automattic.com
Mon Jun 28 08:08:22 UTC 2010


#14083: Specific action hooks for different content types on load of the edit
screen
----------------------------+-----------------------------------------------
 Reporter:  simonwheatley   |       Owner:                                      
     Type:  enhancement     |      Status:  new                                 
 Priority:  normal          |   Milestone:  3.0.1                               
Component:  Administration  |     Version:                                      
 Severity:  normal          |    Keywords:  has-patch dev-feedback needs-testing
----------------------------+-----------------------------------------------

Comment(by simonwheatley):

 Replying to [comment:6 johnbillion]:
 > Replying to [ticket:14083 simonwheatley]:
 > > 2. Adds some new and useful dynamically constructed hooks based on the
 $typenow and $taxnow variables.
 > "load-edit-tags.php-type-post-tax-category" is a bit of an unweildy hook
 name in my opinion. I don't think the hook name is the best place to pass
 so much context.
 >
 > Would we not be better off sticking with "load-$pagenow" and passing the
 context (post type and taxonomy) as a parameter?

 You end up with more conditionals in the hooked function in the plugin if
 you pass more context, and as there's potentially a lot of different
 context this might feel a little messy. I like the idea of keeping the
 hooks precisely targetted, personally, but I guess it's a matter of
 taste... I do agree that the hooks end up pretty long.

 Attaching a diff as per your suggestion so others can comment.



 S

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


More information about the wp-trac mailing list