WordPress.org

Make WordPress Core

Changeset 25050


Ignore:
Timestamp:
08/17/13 20:20:24 (8 months ago)
Author:
ocean90
Message:

Introduce save_post_{$post_type} hook.

The hook is fired before the general save_post hook and has the same args as save_post.

props bmb, SergeyBiryukov, ocean90, fixes #16176.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r24983 r25050  
    26172617 * @uses do_action() Calls 'pre_post_update' on post ID if this is an update. 
    26182618 * @uses do_action() Calls 'edit_post' action on post ID and post data if this is an update. 
    2619  * @uses do_action() Calls 'save_post' and 'wp_insert_post' on post id and post data just before returning. 
     2619 * @uses do_action() Calls 'save_post_{$post_type}', 'save_post' and 'wp_insert_post' on post id and post data just before returning. 
    26202620 * @uses apply_filters() Calls 'wp_insert_post_data' passing $data, $postarr prior to database update or insert. 
    26212621 * @uses wp_transition_post_status() 
     
    28792879    } 
    28802880 
     2881    do_action( "save_post_{$post->post_type}", $post_ID, $post, $update ); 
    28812882    do_action( 'save_post', $post_ID, $post, $update ); 
    28822883    do_action( 'wp_insert_post', $post_ID, $post, $update ); 
     
    29492950 * @since 2.1.0 
    29502951 * @uses $wpdb 
    2951  * @uses do_action() Calls 'edit_post', 'save_post', and 'wp_insert_post' on post_id and post data. 
     2952 * @uses do_action() Calls 'edit_post', 'save_post_{$post_type}', 'save_post' and 'wp_insert_post' on post_id and post data. 
    29522953 * 
    29532954 * @param int|object $post Post ID or object. 
     
    29712972 
    29722973    do_action( 'edit_post', $post->ID, $post ); 
     2974    do_action( "save_post_{$post->post_type}", $post->ID, $post, true ); 
    29732975    do_action( 'save_post', $post->ID, $post, true ); 
    29742976    do_action( 'wp_insert_post', $post->ID, $post, true ); 
Note: See TracChangeset for help on using the changeset viewer.