Changeset 34085
- Timestamp:
- 09/12/2015 06:53:56 PM (9 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post-functions.php
r34082 r34085 3043 3043 // These variables are needed by compact() later. 3044 3044 $post_content_filtered = $postarr['post_content_filtered']; 3045 $post_author = empty( $postarr['post_author'] ) ? $user_id : $postarr['post_author'];3045 $post_author = isset( $postarr['post_author'] ) ? $postarr['post_author'] : $user_id; 3046 3046 $ping_status = empty( $postarr['ping_status'] ) ? get_default_comment_status( $post_type, 'pingback' ) : $postarr['ping_status']; 3047 3047 $to_ping = isset( $postarr['to_ping'] ) ? sanitize_trackback_urls( $postarr['to_ping'] ) : ''; -
trunk/tests/phpunit/tests/post.php
r34001 r34085 1201 1201 wp_set_current_user( $old_uid ); 1202 1202 } 1203 1204 /** 1205 * @ticket 32585 1206 */ 1207 public function test_wp_insert_post_author_zero() { 1208 $post_id = $this->factory->post->create( array( 'post_author' => 0 ) ); 1209 1210 $this->assertEquals( 0, get_post( $post_id )->post_author ); 1211 } 1212 1213 /** 1214 * @ticket 32585 1215 */ 1216 public function test_wp_insert_post_author_null() { 1217 $post_id = $this->factory->post->create( array( 'post_author' => null ) ); 1218 1219 $this->assertEquals( $this->author_id, get_post( $post_id )->post_author ); 1220 } 1203 1221 }
Note: See TracChangeset
for help on using the changeset viewer.