Ticket #20305: 20305.diff
File 20305.diff, 3.3 KB (added by , 12 years ago) |
---|
-
wp-includes/ms-blogs.php
292 292 foreach ( array_intersect( array_keys( $details ), $fields ) as $field ) 293 293 $update_details[$field] = $details[$field]; 294 294 295 $ wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) );295 $result = $wpdb->update( $wpdb->blogs, $update_details, array('blog_id' => $blog_id) ); 296 296 297 if ( false === $result ) 298 return false; 299 297 300 // If spam status changed, issue actions. 298 301 if ( $details[ 'spam' ] != $current_details[ 'spam' ] ) { 299 302 if ( $details[ 'spam' ] == 1 ) 300 do_action( "make_spam_blog", $blog_id );303 do_action( 'make_spam_blog', $blog_id ); 301 304 else 302 do_action( "make_ham_blog", $blog_id );305 do_action( 'make_ham_blog', $blog_id ); 303 306 } 304 307 305 if ( isset($details[ 'public' ]) ) { 308 // If mature status changed, issue actions. 309 if ( $details[ 'mature' ] != $current_details[ 'mature' ] ) { 310 if ( $details[ 'mature' ] == 1 ) 311 do_action( 'mature_blog', $blog_id ); 312 else 313 do_action( 'unmature_blog', $blog_id ); 314 } 315 316 // If archived status changed, issue actions. 317 if ( $details[ 'archived' ] != $current_details[ 'archived' ] ) { 318 if ( $details[ 'archived' ] == 1 ) 319 do_action( 'archive_blog', $blog_id ); 320 else 321 do_action( 'unarchive_blog', $blog_id ); 322 } 323 324 // If deleted status changed, issue actions. 325 if ( $details[ 'deleted' ] != $current_details[ 'deleted' ] ) { 326 if ( $details[ 'deleted' ] == 1 ) 327 do_action( 'make_delete_blog', $blog_id ); 328 else 329 do_action( 'make_undelete_blog', $blog_id ); 330 } 331 332 if ( isset( $details[ 'public' ] ) ) { 306 333 switch_to_blog( $blog_id ); 307 334 update_option( 'blog_public', $details[ 'public' ] ); 308 335 restore_current_blog(); … … 642 669 if ( null !== $deprecated ) 643 670 _deprecated_argument( __FUNCTION__, '3.1' ); 644 671 645 if ( ! in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id') ) )672 if ( ! in_array( $pref, array( 'site_id', 'domain', 'path', 'registered', 'last_updated', 'public', 'archived', 'mature', 'spam', 'deleted', 'lang_id') ) ) 646 673 return $value; 647 674 648 $ wpdb->update( $wpdb->blogs, array($pref => $value, 'last_updated' => current_time('mysql', true)), array('blog_id' => $blog_id) );675 $result = $wpdb->update( $wpdb->blogs, array($pref => $value, 'last_updated' => current_time('mysql', true)), array('blog_id' => $blog_id) ); 649 676 650 refresh_blog_details($blog_id); 677 if ( false === $result ) 678 return false; 651 679 680 refresh_blog_details( $blog_id ); 681 652 682 if ( 'spam' == $pref ) 653 683 ( $value == 1 ) ? do_action( 'make_spam_blog', $blog_id ) : do_action( 'make_ham_blog', $blog_id ); 654 684 elseif ( 'mature' == $pref ) 655 685 ( $value == 1 ) ? do_action( 'mature_blog', $blog_id ) : do_action( 'unmature_blog', $blog_id ); 656 686 elseif ( 'archived' == $pref ) 657 687 ( $value == 1 ) ? do_action( 'archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id ); 658 elseif ( ' archived' == $pref )659 ( $value == 1 ) ? do_action( ' archive_blog', $blog_id ) : do_action( 'unarchive_blog', $blog_id );688 elseif ( 'deleted' == $pref ) 689 ( $value == 1 ) ? do_action( 'make_delete_blog', $blog_id ) : do_action( 'make_undelete_blog', $blog_id ); 660 690 661 691 return $value; 662 692 }