Ticket #32991: 32991.patch
| File 32991.patch, 2.9 KB (added by , 11 years ago) |
|---|
-
src/wp-includes/post.php
2610 2610 * @param int $postid Optional. Post ID. Default 0. 2611 2611 * @param bool $force_delete Optional. Whether to bypass trash and force deletion. 2612 2612 * Default false. 2613 * @return array|false|WP_PostFalse on failure.2613 * @return WP_Post|null|false False on failure. 2614 2614 */ 2615 2615 function wp_delete_post( $postid = 0, $force_delete = false ) { 2616 2616 global $wpdb; 2617 2617 2618 if ( !$post = $wpdb->get_row($wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $postid)) )2618 if ( !$post = get_post( $postid ) ) 2619 2619 return $post; 2620 2620 2621 2621 if ( !$force_delete && ( $post->post_type == 'post' || $post->post_type == 'page') && get_post_status( $postid ) != 'trash' && EMPTY_TRASH_DAYS ) … … 2753 2753 * 2754 2754 * @param int $post_id Optional. Post ID. Default is ID of the global $post 2755 2755 * if EMPTY_TRASH_DAYS equals true. 2756 * @return false|array|WP_Post|null Post data array, otherwise false.2756 * @return WP_Post|null|false False on failure. 2757 2757 */ 2758 2758 function wp_trash_post( $post_id = 0 ) { 2759 2759 if ( !EMPTY_TRASH_DAYS ) … … 2791 2791 */ 2792 2792 do_action( 'trashed_post', $post_id ); 2793 2793 2794 return $post;2794 return get_post( $post_id ); 2795 2795 } 2796 2796 2797 2797 /** … … 2800 2800 * @since 2.9.0 2801 2801 * 2802 2802 * @param int $post_id Optional. Post ID. Default is ID of the global $post. 2803 * @return WP_Post| false WP_Post object.False on failure.2803 * @return WP_Post|null|false False on failure. 2804 2804 */ 2805 2805 function wp_untrash_post( $post_id = 0 ) { 2806 2806 if ( !$post = get_post($post_id, ARRAY_A) ) … … 2838 2838 */ 2839 2839 do_action( 'untrashed_post', $post_id ); 2840 2840 2841 return $post;2841 return get_post( $post_id ); 2842 2842 } 2843 2843 2844 2844 /** … … 4873 4873 * @param int $post_id Attachment ID. 4874 4874 * @param bool $force_delete Optional. Whether to bypass trash and force deletion. 4875 4875 * Default false. 4876 * @return mixed False on failure. Post data on success.4876 * @return WP_Post|null|false False on failure. 4877 4877 */ 4878 4878 function wp_delete_attachment( $post_id, $force_delete = false ) { 4879 4879 global $wpdb; 4880 4880 4881 if ( !$post = $wpdb->get_row( $wpdb->prepare("SELECT * FROM $wpdb->posts WHERE ID = %d", $post_id)) )4881 if ( !$post = get_post( $post_id ) ) 4882 4882 return $post; 4883 4883 4884 4884 if ( 'attachment' != $post->post_type ) -
src/wp-includes/revision.php
383 383 * @since 2.6.0 384 384 * 385 385 * @param int|WP_Post $revision_id Revision ID or revision object. 386 * @return array|false|WP_Post|WP_Error|null Null or WP_Error if error, deleted post if success.386 * @return WP_Post|null|false False on failure. 387 387 */ 388 388 function wp_delete_post_revision( $revision_id ) { 389 389 if ( ! $revision = wp_get_post_revision( $revision_id ) ) {
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)