We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents e618148 + 62faae5 commit cc30127Copy full SHA for cc30127
1 file changed
tests/test-timber-post-getter.php
@@ -191,12 +191,25 @@ function testCustomPostTypeAndClassOnSinglePage() {
191
$this->assertEquals(10, count($jobPosts));
192
}
193
194
+ function testPostTypeReturnAgainstArgType() {
195
+ register_post_type('person');
196
+ $jobs = $this->factory->post->create_many( 4, array('post_type' => 'person'));
197
+ $personPostsArray = Timber::get_posts(array('post_type' => 'person'), 'Person');
198
+ $personPostsString = Timber::get_posts('post_type=person', 'Person');
199
+ $this->assertEquals(4, count($personPostsArray));
200
+ $this->assertEquals(4, count($personPostsString));
201
+ }
202
+
203
204
205
class job extends TimberPost {
206
207
208
209
+class Person extends TimberPost {
210
211
+}
212
213
class TimberAlert extends TimberPost {
214
215
0 commit comments