From 1e640c7b0a43875d2d57500d8df9a51b0c401451 Mon Sep 17 00:00:00 2001 From: nacin Date: Thu, 21 Oct 2010 20:23:54 +0000 Subject: [PATCH] Checkboxes over radio buttons for site info tab. Values outside of 0/1 won't be changed, see #12832 for previous discussion. see #15174. git-svn-id: http://svn.automattic.com/wordpress/trunk@15906 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/network/site-info.php | 32 +++++++++++++++++++------------- 1 file changed, 19 insertions(+), 13 deletions(-) diff --git a/wp-admin/network/site-info.php b/wp-admin/network/site-info.php index c05fc9d9d0..24ade8b2aa 100644 --- a/wp-admin/network/site-info.php +++ b/wp-admin/network/site-info.php @@ -47,6 +47,14 @@ if ( isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action'] ) { // update blogs table $blog_data = stripslashes_deep( $_POST['blog'] ); + $existing_details = get_blog_details( $id, false ); + $blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' ); + foreach ( $blog_data_checkboxes as $c ) { + if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) ) + $blog_data[ $c ] = $existing_details->$c; + else + $blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0; + } update_blog_details( $id, $blog_data ); do_action( 'wpmu_update_blog_options' ); @@ -114,29 +122,27 @@ if ( ! empty( $messages ) ) { - + __( 'Public' ) ); + $attribute_fields = array( 'public' => __( 'Public' ) ); if ( ! $is_main_site ) { - $radio_fields['archived'] = __( 'Archived' ); - $radio_fields['spam'] = _x( 'Spam', 'site' ); - $radio_fields['deleted'] = __( 'Deleted' ); + $attribute_fields['archived'] = __( 'Archived' ); + $attribute_fields['spam'] = _x( 'Spam', 'site' ); + $attribute_fields['deleted'] = __( 'Deleted' ); } - $radio_fields['mature'] = __( 'Mature' ); - foreach ( $radio_fields as $field_key => $field_label ) { + $attribute_fields['mature'] = __( 'Mature' ); ?> - + - $field_key, 1 ); ?> /> - - $field_key, 0 ); ?> /> - + $field_label ) : ?> +
+ -