diff --git a/wp-admin/network/edit.php b/wp-admin/network/edit.php index fc7da7204..e5913da81 100644 --- a/wp-admin/network/edit.php +++ b/wp-admin/network/edit.php @@ -398,7 +398,6 @@ switch ( $_GET['action'] ) { wp_die( __( 'You do not have permission to access this page.' ) ); update_blog_status( $id, 'archived', '1' ); - do_action( 'archive_blog', $id ); wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'archive' ), wp_get_referer() ) ); exit(); break; @@ -408,7 +407,6 @@ switch ( $_GET['action'] ) { if ( ! current_user_can( 'manage_sites' ) ) wp_die( __( 'You do not have permission to access this page.' ) ); - do_action( 'unarchive_blog', $id ); update_blog_status( $id, 'archived', '0' ); wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unarchive' ), wp_get_referer() ) ); exit(); @@ -456,6 +454,26 @@ switch ( $_GET['action'] ) { exit(); break; + case 'unmatureblog': + check_admin_referer( 'unmatureblog' ); + if ( ! current_user_can( 'manage_sites' ) ) + wp_die( __( 'You do not have permission to access this page.' ) ); + + update_blog_status( $id, 'mature', '0' ); + wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'unmature' ), wp_get_referer() ) ); + exit(); + break; + + case 'matureblog': + check_admin_referer( 'matureblog' ); + if ( ! current_user_can( 'manage_sites' ) ) + wp_die( __( 'You do not have permission to access this page.' ) ); + + update_blog_status( $id, 'mature', '1' ); + wp_redirect( add_query_arg( array( 'updated' => 'true', 'action' => 'mature' ), wp_get_referer() ) ); + exit(); + break; + // Themes case 'updatethemes': if ( ! current_user_can( 'manage_network_themes' ) ) diff --git a/wp-includes/ms-blogs.php b/wp-includes/ms-blogs.php index 95e6be413..c3f16fd56 100644 --- a/wp-includes/ms-blogs.php +++ b/wp-includes/ms-blogs.php @@ -628,12 +628,14 @@ function update_blog_status( $blog_id, $pref, $value, $refresh = true ) { if ( $refresh ) refresh_blog_details($blog_id); - if ( $pref == 'spam' ) { - if ( $value == 1 ) - do_action( "make_spam_blog", $blog_id ); - else - do_action( "make_ham_blog", $blog_id ); - } + 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 ); return $value; }