Make WordPress Core

Ticket #60038: 60038.2.diff

File 60038.2.diff, 10.0 KB (added by sukhendu2002, 13 months ago)

Patch refreshed

  • src/wp-includes/post.php

     
    43764376                 * @param bool   $add_trashed_suffix Whether to attempt to add the suffix.
    43774377                 * @param string $post_name          The name of the post being updated.
    43784378                 * @param int    $post_id            Post ID.
     4379                 * @param array $unsanitized_postarr An array of unsanitized post data.
    43794380                 */
    4380                 $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_id );
     4381                $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_id, $unsanitized_postarr );
    43814382
    43824383                if ( $add_trashed_suffix ) {
    43834384                        wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_id );
     
    44744475                 *
    44754476                 * @param int   $post_id Post ID.
    44764477                 * @param array $data    Array of unslashed post data.
     4478                 * @param array $unsanitized_postarr An array of unsanitized post data.
    44774479                 */
    4478                 do_action( 'pre_post_update', $post_id, $data );
     4480                do_action( 'pre_post_update', $post_id, $data, $unsanitized_postarr );
    44794481
    44804482                if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
    44814483                        if ( $wp_error ) {
     
    46584660                         * @since 2.0.0
    46594661                         *
    46604662                         * @param int $post_id Attachment ID.
     4663                         * @param array $unsanitized_postarr An array of unsanitized post data.
    46614664                         */
    4662                         do_action( 'edit_attachment', $post_id );
     4665                        do_action( 'edit_attachment', $post_id, $unsanitized_postarr );
    46634666
    46644667                        $post_after = get_post( $post_id );
    46654668
     
    46714674                         * @param int     $post_id      Post ID.
    46724675                         * @param WP_Post $post_after   Post object following the update.
    46734676                         * @param WP_Post $post_before  Post object before the update.
     4677                         * @param array $unsanitized_postarr An array of unsanitized post data.
    46744678                         */
    4675                         do_action( 'attachment_updated', $post_id, $post_after, $post_before );
     4679                        do_action( 'attachment_updated', $post_id, $post_after, $post_before, $unsanitized_postarr );
    46764680                } else {
    46774681
    46784682                        /**
     
    46814685                         * @since 2.0.0
    46824686                         *
    46834687                         * @param int $post_id Attachment ID.
     4688                         * @param array $unsanitized_postarr An array of unsanitized post data.
    46844689                         */
    4685                         do_action( 'add_attachment', $post_id );
     4690                        do_action( 'add_attachment', $post_id, $unsanitized_postarr );
    46864691                }
    46874692
    46884693                return $post_id;
     
    47044709                 *
    47054710                 * @param int     $post_id Post ID.
    47064711                 * @param WP_Post $post    Post object.
     4712                 * @param array $unsanitized_postarr An array of unsanitized post data.
    47074713                 */
    4708                 do_action( "edit_post_{$post->post_type}", $post_id, $post );
     4714                do_action( "edit_post_{$post->post_type}", $post_id, $post, $unsanitized_postarr );
    47094715
    47104716                /**
    47114717                 * Fires once an existing post has been updated.
     
    47144720                 *
    47154721                 * @param int     $post_id Post ID.
    47164722                 * @param WP_Post $post    Post object.
     4723                 * @param array $unsanitized_postarr An array of unsanitized post data.
    47174724                 */
    4718                 do_action( 'edit_post', $post_id, $post );
     4725                do_action( 'edit_post', $post_id, $post, $unsanitized_postarr );
    47194726
    47204727                $post_after = get_post( $post_id );
    47214728
     
    47274734                 * @param int     $post_id      Post ID.
    47284735                 * @param WP_Post $post_after   Post object following the update.
    47294736                 * @param WP_Post $post_before  Post object before the update.
     4737                 * @param array $unsanitized_postarr An array of unsanitized post data.
    47304738                 */
    4731                 do_action( 'post_updated', $post_id, $post_after, $post_before );
     4739                do_action( 'post_updated', $post_id, $post_after, $post_before, $unsanitized_postarr );
    47324740        }
    47334741
    47344742        /**
     
    47474755         * @param int     $post_id Post ID.
    47484756         * @param WP_Post $post    Post object.
    47494757         * @param bool    $update  Whether this is an existing post being updated.
     4758         * @param array $unsanitized_postarr An array of unsanitized post data.
    47504759         */
    4751         do_action( "save_post_{$post->post_type}", $post_id, $post, $update );
     4760        do_action( "save_post_{$post->post_type}", $post_id, $post, $update, $unsanitized_postarr );
    47524761
    47534762        /**
    47544763         * Fires once a post has been saved.
     
    47584767         * @param int     $post_id Post ID.
    47594768         * @param WP_Post $post    Post object.
    47604769         * @param bool    $update  Whether this is an existing post being updated.
     4770         * @param array $unsanitized_postarr An array of unsanitized post data.
    47614771         */
    4762         do_action( 'save_post', $post_id, $post, $update );
     4772        do_action( 'save_post', $post_id, $post, $update, $unsanitized_postarr );
    47634773
    47644774        /**
    47654775         * Fires once a post has been saved.
     
    47694779         * @param int     $post_id Post ID.
    47704780         * @param WP_Post $post    Post object.
    47714781         * @param bool    $update  Whether this is an existing post being updated.
     4782         * @param array $unsanitized_postarr An array of unsanitized post data.
    47724783         */
    4773         do_action( 'wp_insert_post', $post_id, $post, $update );
     4784        do_action( 'wp_insert_post', $post_id, $post, $update, $unsanitized_postarr );
    47744785
    47754786        if ( $fire_after_hooks ) {
    47764787                wp_after_insert_post( $post, $update, $post_before );