Ticket #60038: 60038.1.diff
File 60038.1.diff, 17.6 KB (added by , 14 months ago) |
---|
-
src/wp-includes/post.php
569 569 array( 570 570 'label' => _x( 'Published', 'post status' ), 571 571 'public' => true, 572 '_builtin' => true, /* internal use only. */ 572 '_builtin' => true, /* 573 internal use only. */ 573 574 /* translators: %s: Number of published posts. */ 574 575 'label_count' => _n_noop( 575 576 'Published <span class="count">(%s)</span>', … … 583 584 array( 584 585 'label' => _x( 'Scheduled', 'post status' ), 585 586 'protected' => true, 586 '_builtin' => true, /* internal use only. */ 587 '_builtin' => true, /* 588 internal use only. */ 587 589 /* translators: %s: Number of scheduled posts. */ 588 590 'label_count' => _n_noop( 589 591 'Scheduled <span class="count">(%s)</span>', … … 597 599 array( 598 600 'label' => _x( 'Draft', 'post status' ), 599 601 'protected' => true, 600 '_builtin' => true, /* internal use only. */ 602 '_builtin' => true, /* 603 internal use only. */ 601 604 /* translators: %s: Number of draft posts. */ 602 605 'label_count' => _n_noop( 603 606 'Draft <span class="count">(%s)</span>', … … 612 615 array( 613 616 'label' => _x( 'Pending', 'post status' ), 614 617 'protected' => true, 615 '_builtin' => true, /* internal use only. */ 618 '_builtin' => true, /* 619 internal use only. */ 616 620 /* translators: %s: Number of pending posts. */ 617 621 'label_count' => _n_noop( 618 622 'Pending <span class="count">(%s)</span>', … … 627 631 array( 628 632 'label' => _x( 'Private', 'post status' ), 629 633 'private' => true, 630 '_builtin' => true, /* internal use only. */ 634 '_builtin' => true, /* 635 internal use only. */ 631 636 /* translators: %s: Number of private posts. */ 632 637 'label_count' => _n_noop( 633 638 'Private <span class="count">(%s)</span>', … … 641 646 array( 642 647 'label' => _x( 'Trash', 'post status' ), 643 648 'internal' => true, 644 '_builtin' => true, /* internal use only. */ 649 '_builtin' => true, /* 650 internal use only. */ 645 651 /* translators: %s: Number of trashed posts. */ 646 652 'label_count' => _n_noop( 647 653 'Trash <span class="count">(%s)</span>', … … 676 682 array( 677 683 'label' => _x( 'Pending', 'request status' ), 678 684 'internal' => true, 679 '_builtin' => true, /* internal use only. */ 685 '_builtin' => true, /* 686 internal use only. */ 680 687 /* translators: %s: Number of pending requests. */ 681 688 'label_count' => _n_noop( 682 689 'Pending <span class="count">(%s)</span>', … … 691 698 array( 692 699 'label' => _x( 'Confirmed', 'request status' ), 693 700 'internal' => true, 694 '_builtin' => true, /* internal use only. */ 701 '_builtin' => true, /* 702 internal use only. */ 695 703 /* translators: %s: Number of confirmed requests. */ 696 704 'label_count' => _n_noop( 697 705 'Confirmed <span class="count">(%s)</span>', … … 706 714 array( 707 715 'label' => _x( 'Failed', 'request status' ), 708 716 'internal' => true, 709 '_builtin' => true, /* internal use only. */ 717 '_builtin' => true, /* 718 internal use only. */ 710 719 /* translators: %s: Number of failed requests. */ 711 720 'label_count' => _n_noop( 712 721 'Failed <span class="count">(%s)</span>', … … 721 730 array( 722 731 'label' => _x( 'Completed', 'request status' ), 723 732 'internal' => true, 724 '_builtin' => true, /* internal use only. */ 733 '_builtin' => true, /* 734 internal use only. */ 725 735 /* translators: %s: Number of completed requests. */ 726 736 'label_count' => _n_noop( 727 737 'Completed <span class="count">(%s)</span>', … … 4376 4386 * @param bool $add_trashed_suffix Whether to attempt to add the suffix. 4377 4387 * @param string $post_name The name of the post being updated. 4378 4388 * @param int $post_id Post ID. 4389 * @param array $unsanitized_postarr An array of unsanitized post data. 4379 4390 */ 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 ); 4381 4392 4382 4393 if ( $add_trashed_suffix ) { 4383 4394 wp_add_trashed_suffix_to_post_name_for_trashed_posts( $post_name, $post_id ); … … 4474 4485 * 4475 4486 * @param int $post_id Post ID. 4476 4487 * @param array $data Array of unslashed post data. 4488 * @param array $unsanitized_postarr An array of unsanitized post data. 4477 4489 */ 4478 do_action( 'pre_post_update', $post_id, $data );4490 do_action( 'pre_post_update', $post_id, $data, $unsanitized_postarr ); 4479 4491 4480 4492 if ( false === $wpdb->update( $wpdb->posts, $data, $where ) ) { 4481 4493 if ( $wp_error ) { … … 4658 4670 * @since 2.0.0 4659 4671 * 4660 4672 * @param int $post_id Attachment ID. 4673 * @param array $unsanitized_postarr An array of unsanitized post data. 4661 4674 */ 4662 do_action( 'edit_attachment', $post_id );4675 do_action( 'edit_attachment', $post_id, $unsanitized_postarr ); 4663 4676 4664 4677 $post_after = get_post( $post_id ); 4665 4678 … … 4671 4684 * @param int $post_id Post ID. 4672 4685 * @param WP_Post $post_after Post object following the update. 4673 4686 * @param WP_Post $post_before Post object before the update. 4687 * @param array $unsanitized_postarr An array of unsanitized post data. 4674 4688 */ 4675 do_action( 'attachment_updated', $post_id, $post_after, $post_before );4689 do_action( 'attachment_updated', $post_id, $post_after, $post_before, $unsanitized_postarr ); 4676 4690 } else { 4677 4691 4678 4692 /** … … 4681 4695 * @since 2.0.0 4682 4696 * 4683 4697 * @param int $post_id Attachment ID. 4698 * @param array $unsanitized_postarr An array of unsanitized post data. 4684 4699 */ 4685 do_action( 'add_attachment', $post_id );4700 do_action( 'add_attachment', $post_id, $unsanitized_postarr ); 4686 4701 } 4687 4702 4688 4703 return $post_id; … … 4704 4719 * 4705 4720 * @param int $post_id Post ID. 4706 4721 * @param WP_Post $post Post object. 4722 * @param array $unsanitized_postarr An array of unsanitized post data. 4707 4723 */ 4708 do_action( "edit_post_{$post->post_type}", $post_id, $post );4724 do_action( "edit_post_{$post->post_type}", $post_id, $post, $unsanitized_postarr ); 4709 4725 4710 4726 /** 4711 4727 * Fires once an existing post has been updated. … … 4714 4730 * 4715 4731 * @param int $post_id Post ID. 4716 4732 * @param WP_Post $post Post object. 4733 * @param array $unsanitized_postarr An array of unsanitized post data. 4717 4734 */ 4718 do_action( 'edit_post', $post_id, $post );4735 do_action( 'edit_post', $post_id, $post, $unsanitized_postarr ); 4719 4736 4720 4737 $post_after = get_post( $post_id ); 4721 4738 … … 4727 4744 * @param int $post_id Post ID. 4728 4745 * @param WP_Post $post_after Post object following the update. 4729 4746 * @param WP_Post $post_before Post object before the update. 4747 * @param array $unsanitized_postarr An array of unsanitized post data. 4730 4748 */ 4731 do_action( 'post_updated', $post_id, $post_after, $post_before );4749 do_action( 'post_updated', $post_id, $post_after, $post_before, $unsanitized_postarr ); 4732 4750 } 4733 4751 4734 4752 /** … … 4747 4765 * @param int $post_id Post ID. 4748 4766 * @param WP_Post $post Post object. 4749 4767 * @param bool $update Whether this is an existing post being updated. 4768 * @param array $unsanitized_postarr An array of unsanitized post data. 4750 4769 */ 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 ); 4752 4771 4753 4772 /** 4754 4773 * Fires once a post has been saved. … … 4758 4777 * @param int $post_id Post ID. 4759 4778 * @param WP_Post $post Post object. 4760 4779 * @param bool $update Whether this is an existing post being updated. 4780 * @param array $unsanitized_postarr An array of unsanitized post data. 4761 4781 */ 4762 do_action( 'save_post', $post_id, $post, $update );4782 do_action( 'save_post', $post_id, $post, $update, $unsanitized_postarr ); 4763 4783 4764 4784 /** 4765 4785 * Fires once a post has been saved. … … 4769 4789 * @param int $post_id Post ID. 4770 4790 * @param WP_Post $post Post object. 4771 4791 * @param bool $update Whether this is an existing post being updated. 4792 * @param array $unsanitized_postarr An array of unsanitized post data. 4772 4793 */ 4773 do_action( 'wp_insert_post', $post_id, $post, $update );4794 do_action( 'wp_insert_post', $post_id, $post, $update, $unsanitized_postarr ); 4774 4795 4775 4796 if ( $fire_after_hooks ) { 4776 4797 wp_after_insert_post( $post, $update, $post_before );