Changeset 49731 for trunk/src/wp-includes/post.php
- Timestamp:
- 12/01/2020 08:45:43 PM (4 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r49693 r49731 3717 3717 } else { 3718 3718 $previous_status = 'new'; 3719 $post_before = null; 3719 3720 } 3720 3721 … … 4319 4320 4320 4321 if ( $fire_after_hooks ) { 4321 wp_after_insert_post( $post, $update );4322 wp_after_insert_post( $post, $update, $post_before ); 4322 4323 } 4323 4324 … … 4432 4433 } 4433 4434 4435 $post_before = get_post( $post->ID ); 4436 4434 4437 // Ensure at least one term is applied for taxonomies with a default term. 4435 4438 foreach ( get_object_taxonomies( $post->post_type, 'object' ) as $taxonomy => $tax_object ) { … … 4482 4485 do_action( 'wp_insert_post', $post->ID, $post, true ); 4483 4486 4484 wp_after_insert_post( $post, true );4487 wp_after_insert_post( $post, true, $post_before ); 4485 4488 } 4486 4489 … … 4937 4940 * @since 5.6.0 4938 4941 * 4939 * @param int|WP_Post $post The post ID or object that has been saved. 4940 * @param bool $update Whether this is an existing post being updated. 4941 */ 4942 function wp_after_insert_post( $post, $update ) { 4942 * @param int|WP_Post $post The post ID or object that has been saved. 4943 * @param bool $update Whether this is an existing post being updated. 4944 * @param null|WP_Post $post_before Null for new posts, the WP_Post object prior 4945 * to the update for updated posts. 4946 */ 4947 function wp_after_insert_post( $post, $update, $post_before ) { 4943 4948 $post = get_post( $post ); 4944 4949 if ( ! $post ) { … … 4953 4958 * @since 5.6.0 4954 4959 * 4955 * @param int $post_id Post ID. 4956 * @param WP_Post $post Post object. 4957 * @param bool $update Whether this is an existing post being updated. 4960 * @param int $post_id Post ID. 4961 * @param WP_Post $post Post object. 4962 * @param bool $update Whether this is an existing post being updated. 4963 * @param null|WP_Post $post_before Null for new posts, the WP_Post object prior 4964 * to the update for updated posts. 4958 4965 */ 4959 do_action( 'wp_after_insert_post', $post_id, $post, $update );4966 do_action( 'wp_after_insert_post', $post_id, $post, $update, $post_before ); 4960 4967 } 4961 4968
Note: See TracChangeset
for help on using the changeset viewer.