[wp-trac] [WordPress Trac] #17276: custom post type problems needs addressed

WordPress Trac wp-trac at lists.automattic.com
Thu May 5 06:04:57 UTC 2011


#17276: custom post type problems needs addressed
-------------------------+------------------------------
 Reporter:  squeeky      |       Owner:  squeeky
     Type:  enhancement  |      Status:  new
 Priority:  normal       |   Milestone:  Awaiting Review
Component:  Post Types   |     Version:
 Severity:  normal       |  Resolution:
 Keywords:  needs-patch  |
-------------------------+------------------------------

Comment (by squeeky):

 it seems that the function get_post_types() can not handle 'supports' / or
 maybe i am doing it wrong...

 {{{
                         $args = array(
                                 'capability_type' => 'post',
                                 'publicly_queryable' => true,
                                 'show_in_nav_menus' => true,
                                 'supports' => array('title','editor'),
                         );

                         $post_type_list = (array) $post_type_list;

                         foreach( get_post_types( $args ) as $posttype )
                                 $post_type_list[] = $posttype;
 }}}

 so i opted to do this instead
 {{{
                         $args = array(
                                 'capability_type' => 'post',
                                 'publicly_queryable' => true,
                                 'show_in_nav_menus' => true,
                         );

                         $post_type_list = (array) $post_type_list;

                         foreach( get_post_types( $args ) as $posttype )
                                 if ( post_type_supports($posttype,'title')
 && post_type_supports($posttype,'editor') )
                                         $post_type_list[] = $posttype;
 }}}


 ----

 ----

 i also made a few fixes to my Tag Cloud example - when i decided to look
 really close at function _get_current_taxonomy($instance) - wp-includes
 /default-widgets.php LINE 1040 to 1045 :
 {{{
         function _get_current_taxonomy($instance) {
                 if ( !empty($instance['taxonomy']) &&
 taxonomy_exists($instance['taxonomy']) )
                         return $instance['taxonomy'];

                 return 'post_tag';
         }
 }}}

 it seems somebody somewhere knew i was going to come in and start doing
 what i'm doing - LOL

 that (what i am doing / enhancing these widgets) seems to be the only
 reason for...
 {{{
                 ... ... ... && taxonomy_exists($instance['taxonomy'])
 }}}

 because the only thing the widget currently is used for is post tags and
 post categories / so if the widget was not waiting for me > then the
 question is > who would deactivate post categories --- hmmm / LOL

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


More information about the wp-trac mailing list