Changeset 31098
- Timestamp:
- 01/08/2015 07:52:52 PM (10 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/author-template.php
r30105 r31098 198 198 return 0; 199 199 } 200 return count_user_posts( $post->post_author );200 return count_user_posts( $post->post_author, $post->post_type ); 201 201 } 202 202 -
trunk/tests/phpunit/tests/user/author.php
r28362 r31098 83 83 $this->assertEquals( 1, get_the_author_posts() ); 84 84 } 85 86 /** 87 * @ticket 30904 88 */ 89 function test_get_the_author_posts_with_custom_post_type() { 90 register_post_type( 'wptests_pt' ); 91 92 $cpt_ids = $this->factory->post->create_many( 2, array( 93 'post_author' => $this->author_id, 94 'post_type' => 'wptests_pt', 95 ) ); 96 $GLOBALS['post'] = $cpt_ids[0]; 97 98 $this->assertEquals( 2, get_the_author_posts() ); 99 100 _unregister_post_type( 'wptests_pt' ); 101 } 85 102 }
Note: See TracChangeset
for help on using the changeset viewer.