[wp-trac] [WordPress Trac] #22165: pre_post_insert missing?!

WordPress Trac wp-trac at lists.automattic.com
Thu Oct 11 14:38:26 UTC 2012


#22165: pre_post_insert missing?!
-----------------------------+-------------------------
 Reporter:  thomask          |       Type:  enhancement
   Status:  new              |   Priority:  normal
Milestone:  Awaiting Review  |  Component:  General
  Version:  3.4.2            |   Severity:  trivial
 Keywords:  has-patch        |
-----------------------------+-------------------------
 For client project I need to check user role and some post variable before
 post is saved and if there is not proper value, i want to return him error
 message, so he will knew he have to change it and then save again.

 Problem is, that IMO it is not possible now as there is no pre_post_insert
 action. There is only pre_post_update action
 (http://core.trac.wordpress.org/browser/tags/3.4.2/wp-
 includes/post.php#L2617) but that is called only on update. There are
 save_post and wp_insert_post actions
 (http://core.trac.wordpress.org/browser/tags/3.4.2/wp-
 includes/post.php#L2698) but they are called AFTER the post is saved.
 Actually i do not know how to do it (OK, i can do javascript check, but it
 will not work without JS) unless there will be some pre_post_insert
 action.

 Actually this was allready requested 2 years ago
 http://core.trac.wordpress.org/ticket/15230, there is a patch, but nothing
 happens.

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


More information about the wp-trac mailing list