[wp-trac] [WordPress Trac] #15515: content_save_pre et al don't supply context

WordPress Trac wp-trac at lists.automattic.com
Sat Nov 20 06:19:49 UTC 2010


#15515: content_save_pre et al don't supply context
-------------------------+--------------------------------------------------
 Reporter:  johnbillion  |       Owner:                 
     Type:  enhancement  |      Status:  new            
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Plugins      |     Version:                 
 Severity:  normal       |    Keywords:                 
-------------------------+--------------------------------------------------
 All of the `{field}_save_pre` filters don't provide any additional
 parameters with context. The `{field}_edit_pre` (when editing) and
 `post_{field}` (when displaying) filters pass the $post_id variable as a
 second parameter. The `{field}_save_pre` filter is the odd one out.

 Currently if a plugin uses (for example) the `content_save_pre` filter and
 needs to know anything about the post (eg. the post type) then it has to
 use the global $post object directly. It works, but it's not ideal.

 Can we add some context to these hooks? All they need is a second
 parameter containing the $post_id variable to bring them in line with the
 other field filters.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15515>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list