[wp-trac] [WordPress Trac] #20305: update_blog_status should also handle delete/undelete cases

WordPress Trac wp-trac at lists.automattic.com
Mon Mar 26 22:59:32 UTC 2012


#20305: update_blog_status should also handle delete/undelete cases
--------------------------+-----------------------------
 Reporter:  Kyrylo        |      Owner:
     Type:  defect (bug)  |     Status:  new
 Priority:  normal        |  Milestone:  Awaiting Review
Component:  Multisite     |    Version:  3.2.1
 Severity:  normal        |   Keywords:  has-patch
--------------------------+-----------------------------
 function update_blog_status defined in /includes/ms-blog.php fires the
 following actions:

 {{{
 ...
         if ( 'spam' == $pref )
                 ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id )
 :     do_action( 'make_ham_blog', $blog_id );
         elseif ( 'mature' == $pref )
                 ( $value == 1 ) ? do_action( 'mature_blog', $blog_id ) :
 do_action( 'unmature_blog', $blog_id );
         elseif ( 'archived' == $pref )
                 ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) :
 do_action( 'unarchive_blog', $blog_id );
         elseif ( 'archived' == $pref )
                 ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) :
 do_action( 'unarchive_blog', $blog_id );
 ...
 }}}

 As you see 'archived' is handled twice, while 'deleted' is not handled at
 all.

 The the code should go as follows:

 {{{
 ...
         if ( 'spam' == $pref )
                 ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id )
 :     do_action( 'make_ham_blog', $blog_id );
         elseif ( 'mature' == $pref )
                 ( $value == 1 ) ? do_action( 'mature_blog', $blog_id ) :
 do_action( 'unmature_blog', $blog_id );
         elseif ( 'archived' == $pref )
                 ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) :
 do_action( 'unarchive_blog', $blog_id );
         elseif ( 'deleted' == $pref )
                 ( $value == 1 ) ? do_action( 'delete_blog', $blog_id ) :
 do_action( 'undelete_blog', $blog_id );
 ...
 }}}

 Please include in the next release. Thank you.

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


More information about the wp-trac mailing list