[wp-trac] [WordPress Trac] #12966: get_post_types returning more than desired results
WordPress Trac
wp-trac at lists.automattic.com
Sun Apr 11 20:41:07 UTC 2010
#12966: get_post_types returning more than desired results
--------------------------+-------------------------------------------------
Reporter: michaelh | Owner:
Type: defect (bug) | Status: new
Priority: normal | Milestone:
Component: Template | Version: 3.0
Severity: normal | Keywords:
--------------------------+-------------------------------------------------
In addition to the desired custom post types, other extraneous post types
such as posts, pages, and attachments, are being returned with this
get_post_types example:
{{{
<?php
//get list of public queryable, custom post types
$args=array(
'publicly_queryable' => true,
'_builtin' => false
);
$output = 'objects'; // names or objects
$post_types=get_post_types($args,$output);
foreach ($post_types as $post_type ) {
echo "<pre>"; print_r($post_type); echo "</pre>";
}
?>
}}}
Using this fares no better:
{{{
$args=array(
'public' => true,
'_builtin' => false
);
}}}
--
Ticket URL: <http://core.trac.wordpress.org/ticket/12966>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software
More information about the wp-trac
mailing list