[wpmu-trac] [WordPress MU Trac] #563: create_empty_blog return value

WordPress MU Trac wpmu-trac at lists.automattic.com
Thu Feb 21 12:39:12 GMT 2008


#563: create_empty_blog return value
-------------------------+--------------------------------------------------
 Reporter:  v.guerard    |       Owner:  somebody         
     Type:  enhancement  |      Status:  new              
 Priority:  normal       |   Milestone:  WPMU 1.0         
Component:  component1   |     Version:  1.0              
 Severity:  normal       |    Keywords:  create_empty_blog
-------------------------+--------------------------------------------------
 well, in wp-admin/wpmu-functions.php, we can found a function called
 "create_empty_blog"


 {{{
 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 )
 {
         global $wpdb;
         [...]
         if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
                 return __('error: problem creating blog entry');

         switch_to_blog($blog_id);
         install_blog($blog_id);
         restore_current_blog();

         return true;
 }
 }}}


 It works great, but the return value is only '''true''' ... so it s
 impossible to get the ID of the created blog.

 I think this code is better with '''return ($blog_id);'''

 {{{
 function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 )
 {
         global $wpdb;
         [...]
         if ( ! $blog_id = insert_blog($domain, $path, $site_id) )
                 return __('error: problem creating blog entry');

         switch_to_blog($blog_id);
         install_blog($blog_id);
         restore_current_blog();

         return ($blog_id);
 }
 }}}

-- 
Ticket URL: <http://trac.mu.wordpress.org/ticket/563>
WordPress MU Trac <http://mu.wordpress.org/>
WordPress Multiuser


More information about the wpmu-trac mailing list