Skip to content

Commit

Permalink
Triggers
Browse files Browse the repository at this point in the history
  • Loading branch information
swissspidy committed Dec 11, 2024
1 parent 708bdf2 commit d02f05c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/wp-includes/post.php
Original file line number Diff line number Diff line change
Expand Up @@ -4985,6 +4985,8 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
do_action( 'add_attachment', $post_id );
}

clear_user_posts_count_cache( $post_author, $post_type );

return $post_id;
}

Expand Down Expand Up @@ -5072,7 +5074,7 @@ function wp_insert_post( $postarr, $wp_error = false, $fire_after_hooks = true )
*/
do_action( 'wp_insert_post', $post_id, $post, $update );

clear_user_posts_count_cache( $post->post_author, $post_type );
clear_user_posts_count_cache( $post_author, $post_type );

if ( $fire_after_hooks ) {
wp_after_insert_post( $post, $update, $post_before );
Expand Down

0 comments on commit d02f05c

Please sign in to comment.