[wp-trac] [WordPress Trac] #34706: Introduce an edit_post_{$post->post_type} action

WordPress Trac noreply at wordpress.org
Wed Feb 28 21:52:16 UTC 2018


#34706: Introduce an edit_post_{$post->post_type} action
-------------------------------+------------------
 Reporter:  garrett-eclipse    |       Owner:
     Type:  enhancement        |      Status:  new
 Priority:  normal             |   Milestone:  5.0
Component:  Posts, Post Types  |     Version:  4.4
 Severity:  normal             |  Resolution:
 Keywords:  close              |     Focuses:
-------------------------------+------------------

Comment (by garrett-eclipse):

 Thanks @Mte90 for taking this on, sorry I didn't take a stab at it haven't
 had time outside of work since I had kids.

 The patch looks great.

 And I think the main benefit on this hook just like the save_post is to
 allow for cleaner code without the post_type conditional check.

 An excerpt explaining from here;
 https://codex.wordpress.org/Plugin_API/Action_Reference/save_post
 >NOTE: As of WP 3.7, an alternative action has been introduced, which is
 called for specific post types: save_post_{post_type}. >Hooking to this
 action you wouldn't have to check on the post type (ie: if ( $slug !=
 $_POST['post_type'] ) in the sample above).

 Hope that's helpful in determining if this should push forward

--
Ticket URL: <https://core.trac.wordpress.org/ticket/34706#comment:7>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list