Changeset 34668
- Timestamp:
- 09/28/2015 07:25:05 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-functions.php
r34566 r34668 2519 2519 2520 2520 $post['post_status'] = 'trash'; 2521 wp_insert_post( $post);2521 wp_insert_post( wp_slash( $post ) ); 2522 2522 2523 2523 wp_trash_post_comments($post_id); … … 2566 2566 delete_post_meta($post_id, '_wp_trash_meta_time'); 2567 2567 2568 wp_insert_post( $post);2568 wp_insert_post( wp_slash( $post ) ); 2569 2569 2570 2570 wp_untrash_post_comments($post_id); -
trunk/tests/phpunit/tests/post/slashes.php
r31065 r34668 130 130 } 131 131 132 /** 133 * @ticket 27550 134 */ 135 function test_wp_trash_untrash() { 136 $post = array( 137 'post_title' => $this->slash_1, 138 'post_content' => $this->slash_3, 139 'post_excerpt' => $this->slash_5, 140 ); 141 $id = wp_insert_post( wp_slash( $post ) ); 142 143 $trashed = wp_trash_post( $id ); 144 $this->assertNotEmpty( $trashed ); 145 146 $post = get_post( $id ); 147 148 $this->assertEquals( $this->slash_1, $post->post_title ); 149 $this->assertEquals( $this->slash_3, $post->post_content ); 150 $this->assertEquals( $this->slash_5, $post->post_excerpt ); 151 152 $untrashed = wp_untrash_post( $id ); 153 $this->assertNotEmpty( $untrashed ); 154 155 $post = get_post( $id ); 156 157 $this->assertEquals( $this->slash_1, $post->post_title ); 158 $this->assertEquals( $this->slash_3, $post->post_content ); 159 $this->assertEquals( $this->slash_5, $post->post_excerpt ); 160 } 132 161 }
Note: See TracChangeset
for help on using the changeset viewer.