Changeset 35800
- Timestamp:
- 12/06/2015 09:57:59 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r35725 r35800 2873 2873 * Default is the value of 'default_ping_status' option. 2874 2874 * @type string $post_password The password to access the post. Default empty. 2875 * @type string $post_name The post name. Default is the sanitized post title. 2875 * @type string $post_name The post name. Default is the sanitized post title 2876 * when creating a new post. 2876 2877 * @type string $to_ping Space or carriage return-separated list of URLs to ping. 2877 2878 * Default empty. … … 2954 2955 if ( isset( $postarr['post_name'] ) ) { 2955 2956 $post_name = $postarr['post_name']; 2957 } elseif ( $update ) { 2958 // For an update, don't modify the post_name if it wasn't supplied as an argument. 2959 $post_name = $post_before->post_name; 2956 2960 } 2957 2961 -
trunk/tests/phpunit/tests/post.php
r35705 r35800 1190 1190 1191 1191 /** 1192 * If a post is updated without providing a post_name param, 1193 * a new slug should not be generated. 1194 * 1195 * @ticket 34865 1196 */ 1197 function test_post_updates_without_slug_provided() { 1198 $post_id = self::factory()->post->create( array( 1199 'post_title' => 'Stuff', 1200 'post_status' => 'publish' 1201 ) ); 1202 1203 $data = array( 1204 'ID' => $post_id, 1205 'post_title' => 'Stuff and Things' 1206 ); 1207 1208 wp_insert_post( $data ); 1209 1210 $updated_post = get_post( $post_id ); 1211 // Ensure changing the post_title didn't modify the post_name. 1212 $this->assertEquals('stuff', $updated_post->post_name); 1213 } 1214 1215 /** 1192 1216 * @ticket 32585 1193 1217 */
Note: See TracChangeset
for help on using the changeset viewer.