[wp-trac] [WordPress Trac] #14669: get_categories returns only after page reload all cats

WordPress Trac wp-trac at lists.automattic.com
Sun Aug 22 18:21:26 UTC 2010


#14669: get_categories returns only after page reload all cats
-----------------------------+----------------------------------------------
 Reporter:  christian_gnoth  |       Owner:                 
     Type:  defect (bug)     |      Status:  new            
 Priority:  normal           |   Milestone:  Awaiting Review
Component:  General          |     Version:  3.0.1          
 Severity:  normal           |    Keywords:                 
-----------------------------+----------------------------------------------
 I am using in a plugin the following script:


 {{{
   //  check if default cat exists
   if ( !get_cat_ID('ImportFit') )
   {
     wp_create_category( 'ImportFit' );
   }

   $categories = get_categories(array('hide_empty' => false));

 }}}

 with a var_dump on $categories I can see, that the created category is
 returned only after one page reload. in the category view in the backend
 the created cat is visible.

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/14669>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list