Make WordPress Core


Ignore:
Timestamp:
01/08/2015 07:52:52 PM (10 years ago)
Author:
SergeyBiryukov
Message:

Pass post type to count_user_posts() in get_the_author_posts().

props Caspie, tyxla.
fixes #30904.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tests/phpunit/tests/user/author.php

    r28362 r31098  
    8383        $this->assertEquals( 1, get_the_author_posts() );
    8484    }
     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    }
    85102}
Note: See TracChangeset for help on using the changeset viewer.