Make WordPress Core

Ticket #60038: 60038.1.diff

File 60038.1.diff, 17.6 KB (added by sukhendu2002, 14 months ago)
  • src/wp-includes/post.php

     
    569569                array(
    570570                        'label'       => _x( 'Published', 'post status' ),
    571571                        'public'      => true,
    572                         '_builtin'    => true, /* internal use only. */
     572                        '_builtin'    => true, /*
     573                internal use only. */
    573574                        /* translators: %s: Number of published posts. */
    574575                        'label_count' => _n_noop(
    575576                                'Published <span class="count">(%s)</span>',
     
    583584                array(
    584585                        'label'       => _x( 'Scheduled', 'post status' ),
    585586                        'protected'   => true,
    586                         '_builtin'    => true, /* internal use only. */
     587                        '_builtin'    => true, /*
     588                internal use only. */
    587589                        /* translators: %s: Number of scheduled posts. */
    588590                        'label_count' => _n_noop(
    589591                                'Scheduled <span class="count">(%s)</span>',
     
    597599                array(
    598600                        'label'         => _x( 'Draft', 'post status' ),
    599601                        'protected'     => true,
    600                         '_builtin'      => true, /* internal use only. */
     602                        '_builtin'      => true, /*
     603                internal use only. */
    601604                        /* translators: %s: Number of draft posts. */
    602605                        'label_count'   => _n_noop(
    603606                                'Draft <span class="count">(%s)</span>',
     
    612615                array(
    613616                        'label'         => _x( 'Pending', 'post status' ),
    614617                        'protected'     => true,
    615                         '_builtin'      => true, /* internal use only. */
     618                        '_builtin'      => true, /*
     619                internal use only. */
    616620                        /* translators: %s: Number of pending posts. */
    617621                        'label_count'   => _n_noop(
    618622                                'Pending <span class="count">(%s)</span>',
     
    627631                array(
    628632                        'label'       => _x( 'Private', 'post status' ),
    629633                        'private'     => true,
    630                         '_builtin'    => true, /* internal use only. */
     634                        '_builtin'    => true, /*
     635                internal use only. */
    631636                        /* translators: %s: Number of private posts. */
    632637                        'label_count' => _n_noop(
    633638                                'Private <span class="count">(%s)</span>',
     
    641646                array(
    642647                        'label'                     => _x( 'Trash', 'post status' ),
    643648                        'internal'                  => true,
    644                         '_builtin'                  => true, /* internal use only. */
     649                        '_builtin'                  => true, /*
     650                internal use only. */
    645651                        /* translators: %s: Number of trashed posts. */
    646652                        'label_count'               => _n_noop(
    647653                                'Trash <span class="count">(%s)</span>',
     
    676682                array(
    677683                        'label'               => _x( 'Pending', 'request status' ),
    678684                        'internal'            => true,
    679                         '_builtin'            => true, /* internal use only. */
     685                        '_builtin'            => true, /*
     686                internal use only. */
    680687                        /* translators: %s: Number of pending requests. */
    681688                        'label_count'         => _n_noop(
    682689                                'Pending <span class="count">(%s)</span>',
     
    691698                array(
    692699                        'label'               => _x( 'Confirmed', 'request status' ),
    693700                        'internal'            => true,
    694                         '_builtin'            => true, /* internal use only. */
     701                        '_builtin'            => true, /*
     702                internal use only. */
    695703                        /* translators: %s: Number of confirmed requests. */
    696704                        'label_count'         => _n_noop(
    697705                                'Confirmed <span class="count">(%s)</span>',
     
    706714                array(
    707715                        'label'               => _x( 'Failed', 'request status' ),
    708716                        'internal'            => true,
    709                         '_builtin'            => true, /* internal use only. */
     717                        '_builtin'            => true, /*
     718                internal use only. */
    710719                        /* translators: %s: Number of failed requests. */
    711720                        'label_count'         => _n_noop(
    712721                                'Failed <span class="count">(%s)</span>',
     
    721730                array(
    722731                        'label'               => _x( 'Completed', 'request status' ),
    723732                        'internal'            => true,
    724                         '_builtin'            => true, /* internal use only. */
     733                        '_builtin'            => true, /*
     734                internal use only. */
    725735                        /* translators: %s: Number of completed requests. */
    726736                        'label_count'         => _n_noop(
    727737                                'Completed <span class="count">(%s)</span>',
     
    43764386                 * @param bool   $add_trashed_suffix Whether to attempt to add the suffix.
    43774387                 * @param string $post_name          The name of the post being updated.
    43784388                 * @param int    $post_id            Post ID.
     4389                 * @param array $unsanitized_postarr An array of unsanitized post data.
    43794390                 */
    4380                 $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_id );
     4391                $add_trashed_suffix = apply_filters( 'add_trashed_suffix_to_trashed_posts', true, $post_name, $post_id, $unsanitized_postarr );
    43814392
    43824393                if ( $add_trashed_suffix ) {
    43834394                        wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_id );
     
    44744485                 *
    44754486                 * @param int   $post_id Post ID.
    44764487                 * @param array $data    Array of unslashed post data.
     4488                 * @param array $unsanitized_postarr An array of unsanitized post data.
    44774489                 */
    4478                 do_action( 'pre_post_update', $post_id, $data );
     4490                do_action( 'pre_post_update', $post_id, $data, $unsanitized_postarr );
    44794491
    44804492                if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) {
    44814493                        if ( $wp_error ) {
     
    46584670                         * @since 2.0.0
    46594671                         *
    46604672                         * @param int $post_id Attachment ID.
     4673                         * @param array $unsanitized_postarr An array of unsanitized post data.
    46614674                         */
    4662                         do_action( 'edit_attachment', $post_id );
     4675                        do_action( 'edit_attachment', $post_id, $unsanitized_postarr );
    46634676
    46644677                        $post_after = get_post( $post_id );
    46654678
     
    46714684                         * @param int     $post_id      Post ID.
    46724685                         * @param WP_Post $post_after   Post object following the update.
    46734686                         * @param WP_Post $post_before  Post object before the update.
     4687                         * @param array $unsanitized_postarr An array of unsanitized post data.
    46744688                         */
    4675                         do_action( 'attachment_updated', $post_id, $post_after, $post_before );
     4689                        do_action( 'attachment_updated', $post_id, $post_after, $post_before, $unsanitized_postarr );
    46764690                } else {
    46774691
    46784692                        /**
     
    46814695                         * @since 2.0.0
    46824696                         *
    46834697                         * @param int $post_id Attachment ID.
     4698                         * @param array $unsanitized_postarr An array of unsanitized post data.
    46844699                         */
    4685                         do_action( 'add_attachment', $post_id );
     4700                        do_action( 'add_attachment', $post_id, $unsanitized_postarr );
    46864701                }
    46874702
    46884703                return $post_id;
     
    47044719                 *
    47054720                 * @param int     $post_id Post ID.
    47064721                 * @param WP_Post $post    Post object.
     4722                 * @param array $unsanitized_postarr An array of unsanitized post data.
    47074723                 */
    4708                 do_action( "edit_post_{$post->post_type}", $post_id, $post );
     4724                do_action( "edit_post_{$post->post_type}", $post_id, $post, $unsanitized_postarr );
    47094725
    47104726                /**
    47114727                 * Fires once an existing post has been updated.
     
    47144730                 *
    47154731                 * @param int     $post_id Post ID.
    47164732                 * @param WP_Post $post    Post object.
     4733                 * @param array $unsanitized_postarr An array of unsanitized post data.
    47174734                 */
    4718                 do_action( 'edit_post', $post_id, $post );
     4735                do_action( 'edit_post', $post_id, $post, $unsanitized_postarr );
    47194736
    47204737                $post_after = get_post( $post_id );
    47214738
     
    47274744                 * @param int     $post_id      Post ID.
    47284745                 * @param WP_Post $post_after   Post object following the update.
    47294746                 * @param WP_Post $post_before  Post object before the update.
     4747                 * @param array $unsanitized_postarr An array of unsanitized post data.
    47304748                 */
    4731                 do_action( 'post_updated', $post_id, $post_after, $post_before );
     4749                do_action( 'post_updated', $post_id, $post_after, $post_before, $unsanitized_postarr );
    47324750        }
    47334751
    47344752        /**
     
    47474765         * @param int     $post_id Post ID.
    47484766         * @param WP_Post $post    Post object.
    47494767         * @param bool    $update  Whether this is an existing post being updated.
     4768         * @param array $unsanitized_postarr An array of unsanitized post data.
    47504769         */
    4751         do_action( "save_post_{$post->post_type}", $post_id, $post, $update );
     4770        do_action( "save_post_{$post->post_type}", $post_id, $post, $update, $unsanitized_postarr );
    47524771
    47534772        /**
    47544773         * Fires once a post has been saved.
     
    47584777         * @param int     $post_id Post ID.
    47594778         * @param WP_Post $post    Post object.
    47604779         * @param bool    $update  Whether this is an existing post being updated.
     4780         * @param array $unsanitized_postarr An array of unsanitized post data.
    47614781         */
    4762         do_action( 'save_post', $post_id, $post, $update );
     4782        do_action( 'save_post', $post_id, $post, $update, $unsanitized_postarr );
    47634783
    47644784        /**
    47654785         * Fires once a post has been saved.
     
    47694789         * @param int     $post_id Post ID.
    47704790         * @param WP_Post $post    Post object.
    47714791         * @param bool    $update  Whether this is an existing post being updated.
     4792         * @param array $unsanitized_postarr An array of unsanitized post data.
    47724793         */
    4773         do_action( 'wp_insert_post', $post_id, $post, $update );
     4794        do_action( 'wp_insert_post', $post_id, $post, $update, $unsanitized_postarr );
    47744795
    47754796        if ( $fire_after_hooks ) {
    47764797                wp_after_insert_post( $post, $update, $post_before );