[wp-trac] [WordPress Trac] #7422: pass $post_id to filters in sanitize_post_field() on post updates

WordPress Trac wp-trac at lists.automattic.com
Mon Jul 28 21:18:05 GMT 2008


#7422: pass $post_id to filters in sanitize_post_field() on post updates
-------------------------+--------------------------------------------------
 Reporter:  whoismanu    |       Owner:  anonymous                          
     Type:  enhancement  |      Status:  new                                
 Priority:  normal       |   Milestone:  2.7                                
Component:  General      |     Version:                                     
 Severity:  normal       |    Keywords:  filters sanitize_post_field posting
-------------------------+--------------------------------------------------
 the function sanitize_post_field in wp-includes/post.php calls most of the
 "database writes" post filters (e.g. content_save_pre). if a post is
 updated or created, the function is called in a database context ('db' ==
 $context) and the $post_id argument is not passed to the "database writes"
 filters. while i understand this behavior on post creation ($post_id not
 yet available) it seems to me that on a post update the $post_id is
 readily available and could/should be passed to the filters as well.

 an example where this would be useful is a case where i want to access a
 custom field value of a post that is currently being updated from the
 function hooked into content_save_pre. in its current form without the
 $post_id argument this doesn't seem to be possible.

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


More information about the wp-trac mailing list