[wp-trac] [WordPress Trac] #12966: get_post_types returning more than desired results

WordPress Trac wp-trac at lists.automattic.com
Fri Nov 4 11:44:17 UTC 2011


#12966: get_post_types returning more than desired results
------------------------------------------+-----------------------
 Reporter:  michaelh                      |       Owner:
     Type:  defect (bug)                  |      Status:  reopened
 Priority:  normal                        |   Milestone:  3.0
Component:  Post Types                    |     Version:  3.2.1
 Severity:  normal                        |  Resolution:
 Keywords:  has-patch tested 2nd-opinion  |
------------------------------------------+-----------------------
Changes (by Ov3rfly):

 * keywords:  has-patch tested => has-patch tested 2nd-opinion
 * status:  closed => reopened
 * version:  3.0 => 3.2.1
 * resolution:  fixed =>


Comment:

 Seems still not to work as expected, example:
 {{{
                 $args = array(
                         'public'   => true,
                         '_builtin' => false,
                         'taxonomies' => array('post_tag')
                 );
                 $post_types = get_post_types($args, 'objects');
                 print_r($post_types);
 }}}
 Expected results: All public custom post types with (at least) taxonomy
 'post_tag'.

 Actual results: All public custom post types, also if they do not have
 'post_tag' set as taxonomy.

 Result of above print_r() http://pastebin.com/4dL7i0DU

 Note the empty taxonomies at post type slider:
 {{{
     ...
     [slider] => stdClass Object
         (
             ...
             [taxonomies] => Array
                 (
                 )
             ...
 }}}


 http://codex.wordpress.org/Function_Reference/get_post_types lists
 'taxonomies' as valid argument.

 Related older thread, but no discussion there:
 http://wordpress.org/support/topic/get_post_types-returns-more-than-
 expected

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/12966#comment:22>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list