Completed
Push — master ( d99bf9...491baf )
by Stephen
13:47
created
src/wp-admin/includes/ms-admin-filters.php 1 patch
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -8,36 +8,36 @@
 block discarded – undo
8 8
  */
9 9
 
10 10
 // Media Hooks.
11
-add_filter( 'wp_handle_upload_prefilter', 'check_upload_size' );
11
+add_filter('wp_handle_upload_prefilter', 'check_upload_size');
12 12
 
13 13
 // User Hooks
14
-add_action( 'admin_notices', 'new_user_email_admin_notice' );
15
-add_action( 'user_admin_notices', 'new_user_email_admin_notice' );
14
+add_action('admin_notices', 'new_user_email_admin_notice');
15
+add_action('user_admin_notices', 'new_user_email_admin_notice');
16 16
 
17
-add_action( 'admin_page_access_denied', '_access_denied_splash', 99 );
17
+add_action('admin_page_access_denied', '_access_denied_splash', 99);
18 18
 
19
-add_action( 'add_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
19
+add_action('add_option_new_admin_email', 'update_option_new_admin_email', 10, 2);
20 20
 
21
-add_action( 'personal_options_update', 'send_confirmation_on_profile_email' );
21
+add_action('personal_options_update', 'send_confirmation_on_profile_email');
22 22
 
23
-add_action( 'update_option_new_admin_email', 'update_option_new_admin_email', 10, 2 );
23
+add_action('update_option_new_admin_email', 'update_option_new_admin_email', 10, 2);
24 24
 
25 25
 // Site Hooks.
26
-add_action( 'wpmueditblogaction', 'upload_space_setting' );
26
+add_action('wpmueditblogaction', 'upload_space_setting');
27 27
 
28 28
 // Taxonomy Hooks
29
-add_filter( 'get_term', 'sync_category_tag_slugs', 10, 2 );
29
+add_filter('get_term', 'sync_category_tag_slugs', 10, 2);
30 30
 
31 31
 // Post Hooks.
32
-add_filter( 'wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2 );
32
+add_filter('wp_insert_post_data', 'avoid_blog_page_permalink_collision', 10, 2);
33 33
 
34 34
 // Tools Hooks.
35
-add_filter( 'import_allow_create_users', 'check_import_new_users' );
35
+add_filter('import_allow_create_users', 'check_import_new_users');
36 36
 
37 37
 // Notices Hooks
38
-add_action( 'admin_notices',         'site_admin_notice' );
39
-add_action( 'network_admin_notices', 'site_admin_notice' );
38
+add_action('admin_notices', 'site_admin_notice');
39
+add_action('network_admin_notices', 'site_admin_notice');
40 40
 
41 41
 // Update Hooks
42
-add_action( 'network_admin_notices', 'update_nag',      3  );
43
-add_action( 'network_admin_notices', 'maintenance_nag', 10 );
42
+add_action('network_admin_notices', 'update_nag', 3);
43
+add_action('network_admin_notices', 'maintenance_nag', 10);
Please login to merge, or discard this patch.
src/wp-admin/media-upload.php 2 patches
Braces   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -9,8 +9,9 @@
 block discarded – undo
9 9
  * @subpackage Administration
10 10
  */
11 11
 
12
-if ( ! isset( $_GET['inline'] ) )
12
+if ( ! isset( $_GET['inline'] ) ) {
13 13
 	define( 'IFRAME_REQUEST' , true );
14
+}
14 15
 
15 16
 /** Load WordPress Administration Bootstrap */
16 17
 require_once( dirname( __FILE__ ) . '/admin.php' );
Please login to merge, or discard this patch.
Spacing   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -9,47 +9,47 @@  discard block
 block discarded – undo
9 9
  * @subpackage Administration
10 10
  */
11 11
 
12
-if ( ! isset( $_GET['inline'] ) )
13
-	define( 'IFRAME_REQUEST' , true );
12
+if ( ! isset($_GET['inline']))
13
+	define('IFRAME_REQUEST', true);
14 14
 
15 15
 /** Load WordPress Administration Bootstrap */
16
-require_once( dirname( __FILE__ ) . '/admin.php' );
16
+require_once(dirname(__FILE__).'/admin.php');
17 17
 
18
-if ( ! current_user_can( 'upload_files' ) ) {
19
-	wp_die( __( 'Sorry, you are not allowed to upload files.' ), 403 );
18
+if ( ! current_user_can('upload_files')) {
19
+	wp_die(__('Sorry, you are not allowed to upload files.'), 403);
20 20
 }
21 21
 
22 22
 wp_enqueue_script('plupload-handlers');
23 23
 wp_enqueue_script('image-edit');
24
-wp_enqueue_script('set-post-thumbnail' );
24
+wp_enqueue_script('set-post-thumbnail');
25 25
 wp_enqueue_style('imgareaselect');
26
-wp_enqueue_script( 'media-gallery' );
26
+wp_enqueue_script('media-gallery');
27 27
 
28
-@header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset'));
28
+@header('Content-Type: '.get_option('html_type').'; charset='.get_option('blog_charset'));
29 29
 
30 30
 // IDs should be integers
31 31
 $ID = isset($ID) ? (int) $ID : 0;
32
-$post_id = isset($post_id)? (int) $post_id : 0;
32
+$post_id = isset($post_id) ? (int) $post_id : 0;
33 33
 
34 34
 // Require an ID for the edit screen.
35
-if ( isset( $action ) && $action == 'edit' && !$ID ) {
35
+if (isset($action) && $action == 'edit' && ! $ID) {
36 36
 	wp_die(
37
-		'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
38
-		'<p>' . __( 'Invalid item ID.' ) . '</p>',
37
+		'<h1>'.__('Cheatin&#8217; uh?').'</h1>'.
38
+		'<p>'.__('Invalid item ID.').'</p>',
39 39
 		403
40 40
 	);
41 41
 }
42 42
 
43
-if ( ! empty( $_REQUEST['post_id'] ) && ! current_user_can( 'edit_post' , $_REQUEST['post_id'] ) ) {
43
+if ( ! empty($_REQUEST['post_id']) && ! current_user_can('edit_post', $_REQUEST['post_id'])) {
44 44
 	wp_die(
45
-		'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
46
-		'<p>' . __( 'Sorry, you are not allowed to edit this item.' ) . '</p>',
45
+		'<h1>'.__('Cheatin&#8217; uh?').'</h1>'.
46
+		'<p>'.__('Sorry, you are not allowed to edit this item.').'</p>',
47 47
 		403
48 48
 	);
49 49
 }
50 50
 
51 51
 // Upload type: image, video, file, ..?
52
-if ( isset($_GET['type']) ) {
52
+if (isset($_GET['type'])) {
53 53
 	$type = strval($_GET['type']);
54 54
 } else {
55 55
 	/**
@@ -60,11 +60,11 @@  discard block
 block discarded – undo
60 60
 	 * @param string $type The default media upload type. Possible values include
61 61
 	 *                     'image', 'audio', 'video', 'file', etc. Default 'file'.
62 62
 	 */
63
-	$type = apply_filters( 'media_upload_default_type', 'file' );
63
+	$type = apply_filters('media_upload_default_type', 'file');
64 64
 }
65 65
 
66 66
 // Tab: gallery, library, or type-specific.
67
-if ( isset($_GET['tab']) ) {
67
+if (isset($_GET['tab'])) {
68 68
 	$tab = strval($_GET['tab']);
69 69
 } else {
70 70
 	/**
@@ -74,13 +74,13 @@  discard block
 block discarded – undo
74 74
 	 *
75 75
 	 * @param string $type The default media popup tab. Default 'type' (From Computer).
76 76
 	 */
77
-	$tab = apply_filters( 'media_upload_default_tab', 'type' );
77
+	$tab = apply_filters('media_upload_default_tab', 'type');
78 78
 }
79 79
 
80 80
 $body_id = 'media-upload';
81 81
 
82 82
 // Let the action code decide how to handle the request.
83
-if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) ) {
83
+if ($tab == 'type' || $tab == 'type_url' || ! array_key_exists($tab, media_upload_tabs())) {
84 84
 	/**
85 85
 	 * Fires inside specific upload-type views in the legacy (pre-3.5.0)
86 86
 	 * media popup based on the current tab.
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
 	 *
96 96
 	 * @since 2.5.0
97 97
 	 */
98
-	do_action( "media_upload_{$type}" );
98
+	do_action("media_upload_{$type}");
99 99
 } else {
100 100
 	/**
101 101
 	 * Fires inside limited and specific upload-tab views in the legacy
@@ -107,6 +107,6 @@  discard block
 block discarded – undo
107 107
 	 *
108 108
 	 * @since 2.5.0
109 109
 	 */
110
-	do_action( "media_upload_{$tab}" );
110
+	do_action("media_upload_{$tab}");
111 111
 }
112 112
 
Please login to merge, or discard this patch.
src/wp-admin/credits.php 2 patches
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -62,8 +62,10 @@  discard block
 block discarded – undo
62 62
 		echo '<h3 class="wp-people-group">' . esc_html( $title ) . "</h3>\n";
63 63
 	}
64 64
 
65
-	if ( ! empty( $group_data['shuffle'] ) )
66
-		shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
65
+	if ( ! empty( $group_data['shuffle'] ) ) {
66
+			shuffle( $group_data['data'] );
67
+	}
68
+	// We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
67 69
 
68 70
 	switch ( $group_data['type'] ) {
69 71
 		case 'list' :
@@ -87,8 +89,9 @@  discard block
 block discarded – undo
87 89
 				$data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
88 90
 				echo '<img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="" />' . "\n";
89 91
 				echo esc_html( $person_data[0] ) . "</a>\n\t";
90
-				if ( ! $compact )
91
-					echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
92
+				if ( ! $compact ) {
93
+									echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
94
+				}
92 95
 				echo "</li>\n";
93 96
 			}
94 97
 			echo "</ul>\n";
Please login to merge, or discard this patch.
Spacing   +55 added lines, -55 removed lines patch added patch discarded remove patch
@@ -7,89 +7,89 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 /** WordPress Administration Bootstrap */
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
11
-require_once( dirname( __FILE__ ) . '/includes/credits.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11
+require_once(dirname(__FILE__).'/includes/credits.php');
12 12
 
13
-$title = __( 'Credits' );
13
+$title = __('Credits');
14 14
 
15
-list( $display_version ) = explode( '-', get_bloginfo( 'version' ) );
15
+list($display_version) = explode('-', get_bloginfo('version'));
16 16
 
17
-include( ABSPATH . 'wp-admin/admin-header.php' );
17
+include(ABSPATH.'wp-admin/admin-header.php');
18 18
 ?>
19 19
 <div class="wrap about-wrap">
20 20
 
21
-<h1><?php printf( __( 'Welcome to WordPress %s' ), $display_version ); ?></h1>
21
+<h1><?php printf(__('Welcome to WordPress %s'), $display_version); ?></h1>
22 22
 
23
-<p class="about-text"><?php printf( __( 'Thank you for updating to the latest version! WordPress %s adds more ways for you to express yourself and represent your brand.' ), $display_version ); ?></p>
23
+<p class="about-text"><?php printf(__('Thank you for updating to the latest version! WordPress %s adds more ways for you to express yourself and represent your brand.'), $display_version); ?></p>
24 24
 
25
-<div class="wp-badge"><?php printf( __( 'Version %s' ), $display_version ); ?></div>
25
+<div class="wp-badge"><?php printf(__('Version %s'), $display_version); ?></div>
26 26
 
27 27
 <h2 class="nav-tab-wrapper wp-clearfix">
28
-	<a href="about.php" class="nav-tab"><?php _e( 'What&#8217;s New' ); ?></a>
29
-	<a href="credits.php" class="nav-tab nav-tab-active"><?php _e( 'Credits' ); ?></a>
30
-	<a href="freedoms.php" class="nav-tab"><?php _e( 'Freedoms' ); ?></a>
28
+	<a href="about.php" class="nav-tab"><?php _e('What&#8217;s New'); ?></a>
29
+	<a href="credits.php" class="nav-tab nav-tab-active"><?php _e('Credits'); ?></a>
30
+	<a href="freedoms.php" class="nav-tab"><?php _e('Freedoms'); ?></a>
31 31
 </h2>
32 32
 
33 33
 <?php
34 34
 
35 35
 $credits = wp_credits();
36 36
 
37
-if ( ! $credits ) {
37
+if ( ! $credits) {
38 38
 	echo '<p class="about-description">';
39 39
 	/* translators: 1: https://wordpress.org/about/, 2: https://make.wordpress.org/ */
40
-	printf( __( 'WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.' ),
40
+	printf(__('WordPress is created by a <a href="%1$s">worldwide team</a> of passionate individuals. <a href="%2$s">Get involved in WordPress</a>.'),
41 41
 		'https://wordpress.org/about/',
42
-		__( 'https://make.wordpress.org/' )
42
+		__('https://make.wordpress.org/')
43 43
 	);
44 44
 	echo '</p>';
45 45
 	echo '</div>';
46
-	include( ABSPATH . 'wp-admin/admin-footer.php' );
46
+	include(ABSPATH.'wp-admin/admin-footer.php');
47 47
 	exit;
48 48
 }
49 49
 
50
-echo '<p class="about-description">' . __( 'WordPress is created by a worldwide team of passionate individuals.' ) . "</p>\n";
50
+echo '<p class="about-description">'.__('WordPress is created by a worldwide team of passionate individuals.')."</p>\n";
51 51
 
52
-foreach ( $credits['groups'] as $group_slug => $group_data ) {
53
-	if ( $group_data['name'] ) {
54
-		if ( 'Translators' == $group_data['name'] ) {
52
+foreach ($credits['groups'] as $group_slug => $group_data) {
53
+	if ($group_data['name']) {
54
+		if ('Translators' == $group_data['name']) {
55 55
 			// Considered a special slug in the API response. (Also, will never be returned for en_US.)
56
-			$title = _x( 'Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section' );
57
-		} elseif ( isset( $group_data['placeholders'] ) ) {
58
-			$title = vsprintf( translate( $group_data['name'] ), $group_data['placeholders'] );
56
+			$title = _x('Translators', 'Translate this to be the equivalent of English Translators in your language for the credits page Translators section');
57
+		} elseif (isset($group_data['placeholders'])) {
58
+			$title = vsprintf(translate($group_data['name']), $group_data['placeholders']);
59 59
 		} else {
60
-			$title = translate( $group_data['name'] );
60
+			$title = translate($group_data['name']);
61 61
 		}
62 62
 
63
-		echo '<h3 class="wp-people-group">' . esc_html( $title ) . "</h3>\n";
63
+		echo '<h3 class="wp-people-group">'.esc_html($title)."</h3>\n";
64 64
 	}
65 65
 
66
-	if ( ! empty( $group_data['shuffle'] ) )
67
-		shuffle( $group_data['data'] ); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
66
+	if ( ! empty($group_data['shuffle']))
67
+		shuffle($group_data['data']); // We were going to sort by ability to pronounce "hierarchical," but that wouldn't be fair to Matt.
68 68
 
69
-	switch ( $group_data['type'] ) {
69
+	switch ($group_data['type']) {
70 70
 		case 'list' :
71
-			array_walk( $group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles'] );
72
-			echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
71
+			array_walk($group_data['data'], '_wp_credits_add_profile_link', $credits['data']['profiles']);
72
+			echo '<p class="wp-credits-list">'.wp_sprintf('%l.', $group_data['data'])."</p>\n\n";
73 73
 			break;
74 74
 		case 'libraries' :
75
-			array_walk( $group_data['data'], '_wp_credits_build_object_link' );
76
-			echo '<p class="wp-credits-list">' . wp_sprintf( '%l.', $group_data['data'] ) . "</p>\n\n";
75
+			array_walk($group_data['data'], '_wp_credits_build_object_link');
76
+			echo '<p class="wp-credits-list">'.wp_sprintf('%l.', $group_data['data'])."</p>\n\n";
77 77
 			break;
78 78
 		default:
79 79
 			$compact = 'compact' == $group_data['type'];
80
-			$classes = 'wp-people-group ' . ( $compact ? 'compact' : '' );
81
-			echo '<ul class="' . $classes . '" id="wp-people-group-' . $group_slug . '">' . "\n";
82
-			foreach ( $group_data['data'] as $person_data ) {
83
-				echo '<li class="wp-person" id="wp-person-' . esc_attr( $person_data[2] ) . '">' . "\n\t";
84
-				echo '<a href="' . esc_url( sprintf( $credits['data']['profiles'], $person_data[2] ) ) . '" class="web">';
80
+			$classes = 'wp-people-group '.($compact ? 'compact' : '');
81
+			echo '<ul class="'.$classes.'" id="wp-people-group-'.$group_slug.'">'."\n";
82
+			foreach ($group_data['data'] as $person_data) {
83
+				echo '<li class="wp-person" id="wp-person-'.esc_attr($person_data[2]).'">'."\n\t";
84
+				echo '<a href="'.esc_url(sprintf($credits['data']['profiles'], $person_data[2])).'" class="web">';
85 85
 				$size = 'compact' == $group_data['type'] ? 30 : 60;
86
-				$data = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
86
+				$data = get_avatar_data($person_data[1].'@md5.gravatar.com', array('size' => $size));
87 87
 				$size *= 2;
88
-				$data2x = get_avatar_data( $person_data[1] . '@md5.gravatar.com', array( 'size' => $size ) );
89
-				echo '<img src="' . esc_url( $data['url'] ) . '" srcset="' . esc_url( $data2x['url'] ) . ' 2x" class="gravatar" alt="" />' . "\n";
90
-				echo esc_html( $person_data[0] ) . "</a>\n\t";
91
-				if ( ! $compact )
92
-					echo '<span class="title">' . translate( $person_data[3] ) . "</span>\n";
88
+				$data2x = get_avatar_data($person_data[1].'@md5.gravatar.com', array('size' => $size));
89
+				echo '<img src="'.esc_url($data['url']).'" srcset="'.esc_url($data2x['url']).' 2x" class="gravatar" alt="" />'."\n";
90
+				echo esc_html($person_data[0])."</a>\n\t";
91
+				if ( ! $compact)
92
+					echo '<span class="title">'.translate($person_data[3])."</span>\n";
93 93
 				echo "</li>\n";
94 94
 			}
95 95
 			echo "</ul>\n";
@@ -100,26 +100,26 @@  discard block
 block discarded – undo
100 100
 ?>
101 101
 <p class="clear"><?php
102 102
 	/* translators: %s: https://make.wordpress.org/ */
103
-	printf( __( 'Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.' ),
104
-		__( 'https://make.wordpress.org/' )
103
+	printf(__('Want to see your name in lights on this page? <a href="%s">Get involved in WordPress</a>.'),
104
+		__('https://make.wordpress.org/')
105 105
 	);
106 106
 ?></p>
107 107
 
108 108
 </div>
109 109
 <?php
110 110
 
111
-include( ABSPATH . 'wp-admin/admin-footer.php' );
111
+include(ABSPATH.'wp-admin/admin-footer.php');
112 112
 
113 113
 return;
114 114
 
115 115
 // These are strings returned by the API that we want to be translatable
116
-__( 'Project Leaders' );
117
-__( 'Core Contributors to WordPress %s' );
118
-__( 'Contributing Developers' );
119
-__( 'Cofounder, Project Lead' );
120
-__( 'Lead Developer' );
121
-__( 'Release Lead' );
122
-__( 'Release Design Lead' );
123
-__( 'Release Deputy' );
124
-__( 'Core Developer' );
125
-__( 'External Libraries' );
116
+__('Project Leaders');
117
+__('Core Contributors to WordPress %s');
118
+__('Contributing Developers');
119
+__('Cofounder, Project Lead');
120
+__('Lead Developer');
121
+__('Release Lead');
122
+__('Release Design Lead');
123
+__('Release Deputy');
124
+__('Core Developer');
125
+__('External Libraries');
Please login to merge, or discard this patch.
src/wp-admin/load-scripts.php 2 patches
Braces   +7 added lines, -4 removed lines patch added patch discarded remove patch
@@ -12,14 +12,16 @@  discard block
 block discarded – undo
12 12
 define( 'WPINC', 'wp-includes' );
13 13
 
14 14
 $load = $_GET['load'];
15
-if ( is_array( $load ) )
15
+if ( is_array( $load ) ) {
16 16
 	$load = implode( '', $load );
17
+}
17 18
 
18 19
 $load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
19 20
 $load = array_unique( explode( ',', $load ) );
20 21
 
21
-if ( empty($load) )
22
+if ( empty($load) ) {
22 23
 	exit;
24
+}
23 25
 
24 26
 require( ABSPATH . 'wp-admin/includes/noop.php' );
25 27
 require( ABSPATH . WPINC . '/script-loader.php' );
@@ -43,8 +45,9 @@  discard block
 block discarded – undo
43 45
 }
44 46
 
45 47
 foreach ( $load as $handle ) {
46
-	if ( !array_key_exists($handle, $wp_scripts->registered) )
47
-		continue;
48
+	if ( !array_key_exists($handle, $wp_scripts->registered) ) {
49
+			continue;
50
+	}
48 51
 
49 52
 	$path = ABSPATH . $wp_scripts->registered[$handle]->src;
50 53
 	$out .= get_file($path) . "\n";
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -8,64 +8,64 @@
 block discarded – undo
8 8
 error_reporting(0);
9 9
 
10 10
 /** Set ABSPATH for execution */
11
-if ( ! defined( 'ABSPATH' ) ) {
12
-	define( 'ABSPATH', dirname( dirname( __FILE__ ) ) . '/' );
11
+if ( ! defined('ABSPATH')) {
12
+	define('ABSPATH', dirname(dirname(__FILE__)).'/');
13 13
 }
14 14
 
15
-define( 'WPINC', 'wp-includes' );
15
+define('WPINC', 'wp-includes');
16 16
 
17 17
 $load = $_GET['load'];
18
-if ( is_array( $load ) )
19
-	$load = implode( '', $load );
18
+if (is_array($load))
19
+	$load = implode('', $load);
20 20
 
21
-$load = preg_replace( '/[^a-z0-9,_-]+/i', '', $load );
22
-$load = array_unique( explode( ',', $load ) );
21
+$load = preg_replace('/[^a-z0-9,_-]+/i', '', $load);
22
+$load = array_unique(explode(',', $load));
23 23
 
24
-if ( empty($load) )
24
+if (empty($load))
25 25
 	exit;
26 26
 
27
-require( ABSPATH . 'wp-admin/includes/noop.php' );
28
-require( ABSPATH . WPINC . '/script-loader.php' );
29
-require( ABSPATH . WPINC . '/version.php' );
27
+require(ABSPATH.'wp-admin/includes/noop.php');
28
+require(ABSPATH.WPINC.'/script-loader.php');
29
+require(ABSPATH.WPINC.'/version.php');
30 30
 
31
-$compress = ( isset($_GET['c']) && $_GET['c'] );
32
-$force_gzip = ( $compress && 'gzip' == $_GET['c'] );
31
+$compress = (isset($_GET['c']) && $_GET['c']);
32
+$force_gzip = ($compress && 'gzip' == $_GET['c']);
33 33
 $expires_offset = 31536000; // 1 year
34 34
 $out = '';
35 35
 
36 36
 $wp_scripts = new WP_Scripts();
37 37
 wp_default_scripts($wp_scripts);
38 38
 
39
-if ( isset( $_SERVER['HTTP_IF_NONE_MATCH'] ) && stripslashes( $_SERVER['HTTP_IF_NONE_MATCH'] ) === $wp_version ) {
39
+if (isset($_SERVER['HTTP_IF_NONE_MATCH']) && stripslashes($_SERVER['HTTP_IF_NONE_MATCH']) === $wp_version) {
40 40
 	$protocol = $_SERVER['SERVER_PROTOCOL'];
41
-	if ( ! in_array( $protocol, array( 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0' ) ) ) {
41
+	if ( ! in_array($protocol, array('HTTP/1.1', 'HTTP/2', 'HTTP/2.0'))) {
42 42
 		$protocol = 'HTTP/1.0';
43 43
 	}
44
-	header( "$protocol 304 Not Modified" );
44
+	header("$protocol 304 Not Modified");
45 45
 	exit();
46 46
 }
47 47
 
48
-foreach ( $load as $handle ) {
49
-	if ( !array_key_exists($handle, $wp_scripts->registered) )
48
+foreach ($load as $handle) {
49
+	if ( ! array_key_exists($handle, $wp_scripts->registered))
50 50
 		continue;
51 51
 
52
-	$path = ABSPATH . $wp_scripts->registered[$handle]->src;
53
-	$out .= get_file($path) . "\n";
52
+	$path = ABSPATH.$wp_scripts->registered[$handle]->src;
53
+	$out .= get_file($path)."\n";
54 54
 }
55 55
 
56 56
 header("Etag: $wp_version");
57 57
 header('Content-Type: application/javascript; charset=UTF-8');
58
-header('Expires: ' . gmdate( "D, d M Y H:i:s", time() + $expires_offset ) . ' GMT');
58
+header('Expires: '.gmdate("D, d M Y H:i:s", time() + $expires_offset).' GMT');
59 59
 header("Cache-Control: public, max-age=$expires_offset");
60 60
 
61
-if ( $compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING']) ) {
61
+if ($compress && ! ini_get('zlib.output_compression') && 'ob_gzhandler' != ini_get('output_handler') && isset($_SERVER['HTTP_ACCEPT_ENCODING'])) {
62 62
 	header('Vary: Accept-Encoding'); // Handle proxies
63
-	if ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip ) {
63
+	if (false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'deflate') && function_exists('gzdeflate') && ! $force_gzip) {
64 64
 		header('Content-Encoding: deflate');
65
-		$out = gzdeflate( $out, 3 );
66
-	} elseif ( false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode') ) {
65
+		$out = gzdeflate($out, 3);
66
+	} elseif (false !== stripos($_SERVER['HTTP_ACCEPT_ENCODING'], 'gzip') && function_exists('gzencode')) {
67 67
 		header('Content-Encoding: gzip');
68
-		$out = gzencode( $out, 3 );
68
+		$out = gzencode($out, 3);
69 69
 	}
70 70
 }
71 71
 
Please login to merge, or discard this patch.
src/wp-admin/edit.php 3 patches
Indentation   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -268,7 +268,7 @@  discard block
 block discarded – undo
268 268
 $bulk_messages['post'] = array(
269 269
 	'updated'   => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),
270 270
 	'locked'    => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :
271
-	                   _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
271
+					   _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
272 272
 	'deleted'   => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),
273 273
 	'trashed'   => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),
274 274
 	'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),
@@ -276,7 +276,7 @@  discard block
 block discarded – undo
276 276
 $bulk_messages['page'] = array(
277 277
 	'updated'   => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),
278 278
 	'locked'    => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :
279
-	                   _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
279
+					   _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
280 280
 	'deleted'   => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),
281 281
 	'trashed'   => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),
282 282
 	'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),
Please login to merge, or discard this patch.
Braces   +40 added lines, -26 removed lines patch added patch discarded remove patch
@@ -9,8 +9,9 @@  discard block
 block discarded – undo
9 9
 /** WordPress Administration Bootstrap */
10 10
 require_once( dirname( __FILE__ ) . '/admin.php' );
11 11
 
12
-if ( ! $typenow )
12
+if ( ! $typenow ) {
13 13
 	wp_die( __( 'Invalid post type.' ) );
14
+}
14 15
 
15 16
 if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
16 17
 	wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
@@ -31,8 +32,9 @@  discard block
 block discarded – undo
31 32
 $post_type = $typenow;
32 33
 $post_type_object = get_post_type_object( $post_type );
33 34
 
34
-if ( ! $post_type_object )
35
+if ( ! $post_type_object ) {
35 36
 	wp_die( __( 'Invalid post type.' ) );
37
+}
36 38
 
37 39
 if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) {
38 40
 	wp_die(
@@ -70,11 +72,13 @@  discard block
 block discarded – undo
70 72
 	check_admin_referer('bulk-posts');
71 73
 
72 74
 	$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'locked', 'ids'), wp_get_referer() );
73
-	if ( ! $sendback )
74
-		$sendback = admin_url( $parent_file );
75
+	if ( ! $sendback ) {
76
+			$sendback = admin_url( $parent_file );
77
+	}
75 78
 	$sendback = add_query_arg( 'paged', $pagenum, $sendback );
76
-	if ( strpos($sendback, 'post.php') !== false )
77
-		$sendback = admin_url($post_new_file);
79
+	if ( strpos($sendback, 'post.php') !== false ) {
80
+			$sendback = admin_url($post_new_file);
81
+	}
78 82
 
79 83
 	if ( 'delete_all' == $doaction ) {
80 84
 		// Prepare for deletion of all posts with a specified post status (i.e. Empty trash).
@@ -102,16 +106,18 @@  discard block
 block discarded – undo
102 106
 			$trashed = $locked = 0;
103 107
 
104 108
 			foreach ( (array) $post_ids as $post_id ) {
105
-				if ( !current_user_can( 'delete_post', $post_id) )
106
-					wp_die( __('Sorry, you are not allowed to move this item to the Trash.') );
109
+				if ( !current_user_can( 'delete_post', $post_id) ) {
110
+									wp_die( __('Sorry, you are not allowed to move this item to the Trash.') );
111
+				}
107 112
 
108 113
 				if ( wp_check_post_lock( $post_id ) ) {
109 114
 					$locked++;
110 115
 					continue;
111 116
 				}
112 117
 
113
-				if ( !wp_trash_post($post_id) )
114
-					wp_die( __('Error in moving to Trash.') );
118
+				if ( !wp_trash_post($post_id) ) {
119
+									wp_die( __('Error in moving to Trash.') );
120
+				}
115 121
 
116 122
 				$trashed++;
117 123
 			}
@@ -121,11 +127,13 @@  discard block
 block discarded – undo
121 127
 		case 'untrash':
122 128
 			$untrashed = 0;
123 129
 			foreach ( (array) $post_ids as $post_id ) {
124
-				if ( !current_user_can( 'delete_post', $post_id) )
125
-					wp_die( __('Sorry, you are not allowed to restore this item from the Trash.') );
130
+				if ( !current_user_can( 'delete_post', $post_id) ) {
131
+									wp_die( __('Sorry, you are not allowed to restore this item from the Trash.') );
132
+				}
126 133
 
127
-				if ( !wp_untrash_post($post_id) )
128
-					wp_die( __('Error in restoring from Trash.') );
134
+				if ( !wp_untrash_post($post_id) ) {
135
+									wp_die( __('Error in restoring from Trash.') );
136
+				}
129 137
 
130 138
 				$untrashed++;
131 139
 			}
@@ -136,15 +144,18 @@  discard block
 block discarded – undo
136 144
 			foreach ( (array) $post_ids as $post_id ) {
137 145
 				$post_del = get_post($post_id);
138 146
 
139
-				if ( !current_user_can( 'delete_post', $post_id ) )
140
-					wp_die( __('Sorry, you are not allowed to delete this item.') );
147
+				if ( !current_user_can( 'delete_post', $post_id ) ) {
148
+									wp_die( __('Sorry, you are not allowed to delete this item.') );
149
+				}
141 150
 
142 151
 				if ( $post_del->post_type == 'attachment' ) {
143
-					if ( ! wp_delete_attachment($post_id) )
144
-						wp_die( __('Error in deleting.') );
152
+					if ( ! wp_delete_attachment($post_id) ) {
153
+											wp_die( __('Error in deleting.') );
154
+					}
145 155
 				} else {
146
-					if ( !wp_delete_post($post_id) )
147
-						wp_die( __('Error in deleting.') );
156
+					if ( !wp_delete_post($post_id) ) {
157
+											wp_die( __('Error in deleting.') );
158
+					}
148 159
 				}
149 160
 				$deleted++;
150 161
 			}
@@ -324,10 +335,11 @@  discard block
 block discarded – undo
324 335
 // If we have a bulk message to issue:
325 336
 $messages = array();
326 337
 foreach ( $bulk_counts as $message => $count ) {
327
-	if ( isset( $bulk_messages[ $post_type ][ $message ] ) )
328
-		$messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) );
329
-	elseif ( isset( $bulk_messages['post'][ $message ] ) )
330
-		$messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) );
338
+	if ( isset( $bulk_messages[ $post_type ][ $message ] ) ) {
339
+			$messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) );
340
+	} elseif ( isset( $bulk_messages['post'][ $message ] ) ) {
341
+			$messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) );
342
+	}
331 343
 
332 344
 	if ( $message == 'trashed' && isset( $_REQUEST['ids'] ) ) {
333 345
 		$ids = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );
@@ -335,8 +347,9 @@  discard block
 block discarded – undo
335 347
 	}
336 348
 }
337 349
 
338
-if ( $messages )
350
+if ( $messages ) {
339 351
 	echo '<div id="message" class="updated notice is-dismissible"><p>' . join( ' ', $messages ) . '</p></div>';
352
+}
340 353
 unset( $messages );
341 354
 
342 355
 $_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] );
@@ -359,8 +372,9 @@  discard block
 block discarded – undo
359 372
 </form>
360 373
 
361 374
 <?php
362
-if ( $wp_list_table->has_items() )
375
+if ( $wp_list_table->has_items() ) {
363 376
 	$wp_list_table->inline_edit();
377
+}
364 378
 ?>
365 379
 
366 380
 <div id="ajax-response"></div>
Please login to merge, or discard this patch.
Spacing   +148 added lines, -150 removed lines patch added patch discarded remove patch
@@ -7,17 +7,17 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 /** WordPress Administration Bootstrap */
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11 11
 
12
-if ( ! $typenow )
13
-	wp_die( __( 'Invalid post type.' ) );
12
+if ( ! $typenow)
13
+	wp_die(__('Invalid post type.'));
14 14
 
15
-if ( ! in_array( $typenow, get_post_types( array( 'show_ui' => true ) ) ) ) {
16
-	wp_die( __( 'Sorry, you are not allowed to edit posts in this post type.' ) );
15
+if ( ! in_array($typenow, get_post_types(array('show_ui' => true)))) {
16
+	wp_die(__('Sorry, you are not allowed to edit posts in this post type.'));
17 17
 }
18 18
 
19
-if ( 'attachment' === $typenow ) {
20
-	if ( wp_redirect( admin_url( 'upload.php' ) ) ) {
19
+if ('attachment' === $typenow) {
20
+	if (wp_redirect(admin_url('upload.php'))) {
21 21
 		exit;
22 22
 	}
23 23
 }
@@ -29,15 +29,15 @@  discard block
 block discarded – undo
29 29
 global $post_type, $post_type_object;
30 30
 
31 31
 $post_type = $typenow;
32
-$post_type_object = get_post_type_object( $post_type );
32
+$post_type_object = get_post_type_object($post_type);
33 33
 
34
-if ( ! $post_type_object )
35
-	wp_die( __( 'Invalid post type.' ) );
34
+if ( ! $post_type_object)
35
+	wp_die(__('Invalid post type.'));
36 36
 
37
-if ( ! current_user_can( $post_type_object->cap->edit_posts ) ) {
37
+if ( ! current_user_can($post_type_object->cap->edit_posts)) {
38 38
 	wp_die(
39
-		'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
40
-		'<p>' . __( 'Sorry, you are not allowed to edit posts in this post type.' ) . '</p>',
39
+		'<h1>'.__('Cheatin&#8217; uh?').'</h1>'.
40
+		'<p>'.__('Sorry, you are not allowed to edit posts in this post type.').'</p>',
41 41
 		403
42 42
 	);
43 43
 }
@@ -46,15 +46,15 @@  discard block
 block discarded – undo
46 46
 $pagenum = $wp_list_table->get_pagenum();
47 47
 
48 48
 // Back-compat for viewing comments of an entry
49
-foreach ( array( 'p', 'attachment_id', 'page_id' ) as $_redirect ) {
50
-	if ( ! empty( $_REQUEST[ $_redirect ] ) ) {
51
-		wp_redirect( admin_url( 'edit-comments.php?p=' . absint( $_REQUEST[ $_redirect ] ) ) );
49
+foreach (array('p', 'attachment_id', 'page_id') as $_redirect) {
50
+	if ( ! empty($_REQUEST[$_redirect])) {
51
+		wp_redirect(admin_url('edit-comments.php?p='.absint($_REQUEST[$_redirect])));
52 52
 		exit;
53 53
 	}
54 54
 }
55
-unset( $_redirect );
55
+unset($_redirect);
56 56
 
57
-if ( 'post' != $post_type ) {
57
+if ('post' != $post_type) {
58 58
 	$parent_file = "edit.php?post_type=$post_type";
59 59
 	$submenu_file = "edit.php?post_type=$post_type";
60 60
 	$post_new_file = "post-new.php?post_type=$post_type";
@@ -66,66 +66,66 @@  discard block
 block discarded – undo
66 66
 
67 67
 $doaction = $wp_list_table->current_action();
68 68
 
69
-if ( $doaction ) {
69
+if ($doaction) {
70 70
 	check_admin_referer('bulk-posts');
71 71
 
72
-	$sendback = remove_query_arg( array('trashed', 'untrashed', 'deleted', 'locked', 'ids'), wp_get_referer() );
73
-	if ( ! $sendback )
74
-		$sendback = admin_url( $parent_file );
75
-	$sendback = add_query_arg( 'paged', $pagenum, $sendback );
76
-	if ( strpos($sendback, 'post.php') !== false )
72
+	$sendback = remove_query_arg(array('trashed', 'untrashed', 'deleted', 'locked', 'ids'), wp_get_referer());
73
+	if ( ! $sendback)
74
+		$sendback = admin_url($parent_file);
75
+	$sendback = add_query_arg('paged', $pagenum, $sendback);
76
+	if (strpos($sendback, 'post.php') !== false)
77 77
 		$sendback = admin_url($post_new_file);
78 78
 
79
-	if ( 'delete_all' == $doaction ) {
79
+	if ('delete_all' == $doaction) {
80 80
 		// Prepare for deletion of all posts with a specified post status (i.e. Empty trash).
81 81
 		$post_status = preg_replace('/[^a-z0-9_-]+/i', '', $_REQUEST['post_status']);
82 82
 		// Validate the post status exists.
83
-		if ( get_post_status_object( $post_status ) ) {
84
-			$post_ids = $wpdb->get_col( $wpdb->prepare( "SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status ) );
83
+		if (get_post_status_object($post_status)) {
84
+			$post_ids = $wpdb->get_col($wpdb->prepare("SELECT ID FROM $wpdb->posts WHERE post_type=%s AND post_status = %s", $post_type, $post_status));
85 85
 		}
86 86
 		$doaction = 'delete';
87
-	} elseif ( isset( $_REQUEST['media'] ) ) {
87
+	} elseif (isset($_REQUEST['media'])) {
88 88
 		$post_ids = $_REQUEST['media'];
89
-	} elseif ( isset( $_REQUEST['ids'] ) ) {
90
-		$post_ids = explode( ',', $_REQUEST['ids'] );
91
-	} elseif ( !empty( $_REQUEST['post'] ) ) {
89
+	} elseif (isset($_REQUEST['ids'])) {
90
+		$post_ids = explode(',', $_REQUEST['ids']);
91
+	} elseif ( ! empty($_REQUEST['post'])) {
92 92
 		$post_ids = array_map('intval', $_REQUEST['post']);
93 93
 	}
94 94
 
95
-	if ( !isset( $post_ids ) ) {
96
-		wp_redirect( $sendback );
95
+	if ( ! isset($post_ids)) {
96
+		wp_redirect($sendback);
97 97
 		exit;
98 98
 	}
99 99
 
100
-	switch ( $doaction ) {
100
+	switch ($doaction) {
101 101
 		case 'trash':
102 102
 			$trashed = $locked = 0;
103 103
 
104
-			foreach ( (array) $post_ids as $post_id ) {
105
-				if ( !current_user_can( 'delete_post', $post_id) )
106
-					wp_die( __('Sorry, you are not allowed to move this item to the Trash.') );
104
+			foreach ((array) $post_ids as $post_id) {
105
+				if ( ! current_user_can('delete_post', $post_id))
106
+					wp_die(__('Sorry, you are not allowed to move this item to the Trash.'));
107 107
 
108
-				if ( wp_check_post_lock( $post_id ) ) {
108
+				if (wp_check_post_lock($post_id)) {
109 109
 					$locked++;
110 110
 					continue;
111 111
 				}
112 112
 
113
-				if ( !wp_trash_post($post_id) )
114
-					wp_die( __('Error in moving to Trash.') );
113
+				if ( ! wp_trash_post($post_id))
114
+					wp_die(__('Error in moving to Trash.'));
115 115
 
116 116
 				$trashed++;
117 117
 			}
118 118
 
119
-			$sendback = add_query_arg( array('trashed' => $trashed, 'ids' => join(',', $post_ids), 'locked' => $locked ), $sendback );
119
+			$sendback = add_query_arg(array('trashed' => $trashed, 'ids' => join(',', $post_ids), 'locked' => $locked), $sendback);
120 120
 			break;
121 121
 		case 'untrash':
122 122
 			$untrashed = 0;
123
-			foreach ( (array) $post_ids as $post_id ) {
124
-				if ( !current_user_can( 'delete_post', $post_id) )
125
-					wp_die( __('Sorry, you are not allowed to restore this item from the Trash.') );
123
+			foreach ((array) $post_ids as $post_id) {
124
+				if ( ! current_user_can('delete_post', $post_id))
125
+					wp_die(__('Sorry, you are not allowed to restore this item from the Trash.'));
126 126
 
127
-				if ( !wp_untrash_post($post_id) )
128
-					wp_die( __('Error in restoring from Trash.') );
127
+				if ( ! wp_untrash_post($post_id))
128
+					wp_die(__('Error in restoring from Trash.'));
129 129
 
130 130
 				$untrashed++;
131 131
 			}
@@ -133,47 +133,47 @@  discard block
 block discarded – undo
133 133
 			break;
134 134
 		case 'delete':
135 135
 			$deleted = 0;
136
-			foreach ( (array) $post_ids as $post_id ) {
136
+			foreach ((array) $post_ids as $post_id) {
137 137
 				$post_del = get_post($post_id);
138 138
 
139
-				if ( !current_user_can( 'delete_post', $post_id ) )
140
-					wp_die( __('Sorry, you are not allowed to delete this item.') );
139
+				if ( ! current_user_can('delete_post', $post_id))
140
+					wp_die(__('Sorry, you are not allowed to delete this item.'));
141 141
 
142
-				if ( $post_del->post_type == 'attachment' ) {
143
-					if ( ! wp_delete_attachment($post_id) )
144
-						wp_die( __('Error in deleting.') );
142
+				if ($post_del->post_type == 'attachment') {
143
+					if ( ! wp_delete_attachment($post_id))
144
+						wp_die(__('Error in deleting.'));
145 145
 				} else {
146
-					if ( !wp_delete_post($post_id) )
147
-						wp_die( __('Error in deleting.') );
146
+					if ( ! wp_delete_post($post_id))
147
+						wp_die(__('Error in deleting.'));
148 148
 				}
149 149
 				$deleted++;
150 150
 			}
151 151
 			$sendback = add_query_arg('deleted', $deleted, $sendback);
152 152
 			break;
153 153
 		case 'edit':
154
-			if ( isset($_REQUEST['bulk_edit']) ) {
154
+			if (isset($_REQUEST['bulk_edit'])) {
155 155
 				$done = bulk_edit_posts($_REQUEST);
156 156
 
157
-				if ( is_array($done) ) {
158
-					$done['updated'] = count( $done['updated'] );
159
-					$done['skipped'] = count( $done['skipped'] );
160
-					$done['locked'] = count( $done['locked'] );
161
-					$sendback = add_query_arg( $done, $sendback );
157
+				if (is_array($done)) {
158
+					$done['updated'] = count($done['updated']);
159
+					$done['skipped'] = count($done['skipped']);
160
+					$done['locked'] = count($done['locked']);
161
+					$sendback = add_query_arg($done, $sendback);
162 162
 				}
163 163
 			}
164 164
 			break;
165 165
 		default:
166 166
 			/** This action is documented in wp-admin/edit-comments.php */
167
-			$sendback = apply_filters( 'handle_bulk_actions-' . get_current_screen()->id, $sendback, $doaction, $post_ids );
167
+			$sendback = apply_filters('handle_bulk_actions-'.get_current_screen()->id, $sendback, $doaction, $post_ids);
168 168
 			break;
169 169
 	}
170 170
 
171
-	$sendback = remove_query_arg( array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback );
171
+	$sendback = remove_query_arg(array('action', 'action2', 'tags_input', 'post_author', 'comment_status', 'ping_status', '_status', 'post', 'bulk_edit', 'post_view'), $sendback);
172 172
 
173 173
 	wp_redirect($sendback);
174 174
 	exit();
175
-} elseif ( ! empty($_REQUEST['_wp_http_referer']) ) {
176
-	 wp_redirect( remove_query_arg( array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI']) ) );
175
+} elseif ( ! empty($_REQUEST['_wp_http_referer'])) {
176
+	 wp_redirect(remove_query_arg(array('_wp_http_referer', '_wpnonce'), wp_unslash($_SERVER['REQUEST_URI'])));
177 177
 	 exit;
178 178
 }
179 179
 
@@ -184,106 +184,104 @@  discard block
 block discarded – undo
184 184
 
185 185
 $title = $post_type_object->labels->name;
186 186
 
187
-if ( 'post' == $post_type ) {
188
-	get_current_screen()->add_help_tab( array(
187
+if ('post' == $post_type) {
188
+	get_current_screen()->add_help_tab(array(
189 189
 	'id'		=> 'overview',
190 190
 	'title'		=> __('Overview'),
191 191
 	'content'	=>
192
-		'<p>' . __('This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.') . '</p>'
193
-	) );
194
-	get_current_screen()->add_help_tab( array(
192
+		'<p>'.__('This screen provides access to all of your posts. You can customize the display of this screen to suit your workflow.').'</p>'
193
+	));
194
+	get_current_screen()->add_help_tab(array(
195 195
 	'id'		=> 'screen-content',
196 196
 	'title'		=> __('Screen Content'),
197 197
 	'content'	=>
198
-		'<p>' . __('You can customize the display of this screen&#8217;s contents in a number of ways:') . '</p>' .
199
-		'<ul>' .
200
-			'<li>' . __('You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.') . '</li>' .
201
-			'<li>' . __( 'You can filter the list of posts by post status using the text links above the posts list to only show posts with that status. The default view is to show all posts.' ) . '</li>' .
202
-			'<li>' . __('You can view posts in a simple title list or with an excerpt using the Screen Options tab.') . '</li>' .
203
-			'<li>' . __('You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.') . '</li>' .
198
+		'<p>'.__('You can customize the display of this screen&#8217;s contents in a number of ways:').'</p>'.
199
+		'<ul>'.
200
+			'<li>'.__('You can hide/display columns based on your needs and decide how many posts to list per screen using the Screen Options tab.').'</li>'.
201
+			'<li>'.__('You can filter the list of posts by post status using the text links above the posts list to only show posts with that status. The default view is to show all posts.').'</li>'.
202
+			'<li>'.__('You can view posts in a simple title list or with an excerpt using the Screen Options tab.').'</li>'.
203
+			'<li>'.__('You can refine the list to show only posts in a specific category or from a specific month by using the dropdown menus above the posts list. Click the Filter button after making your selection. You also can refine the list by clicking on the post author, category or tag in the posts list.').'</li>'.
204 204
 		'</ul>'
205
-	) );
206
-	get_current_screen()->add_help_tab( array(
205
+	));
206
+	get_current_screen()->add_help_tab(array(
207 207
 	'id'		=> 'action-links',
208 208
 	'title'		=> __('Available Actions'),
209 209
 	'content'	=>
210
-		'<p>' . __('Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:') . '</p>' .
211
-		'<ul>' .
212
-			'<li>' . __('<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.') . '</li>' .
213
-			'<li>' . __('<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.') . '</li>' .
214
-			'<li>' . __('<strong>Trash</strong> removes your post from this list and places it in the trash, from which you can permanently delete it.') . '</li>' .
215
-			'<li>' . __('<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post&#8217;s status.') . '</li>' .
210
+		'<p>'.__('Hovering over a row in the posts list will display action links that allow you to manage your post. You can perform the following actions:').'</p>'.
211
+		'<ul>'.
212
+			'<li>'.__('<strong>Edit</strong> takes you to the editing screen for that post. You can also reach that screen by clicking on the post title.').'</li>'.
213
+			'<li>'.__('<strong>Quick Edit</strong> provides inline access to the metadata of your post, allowing you to update post details without leaving this screen.').'</li>'.
214
+			'<li>'.__('<strong>Trash</strong> removes your post from this list and places it in the trash, from which you can permanently delete it.').'</li>'.
215
+			'<li>'.__('<strong>Preview</strong> will show you what your draft post will look like if you publish it. View will take you to your live site to view the post. Which link is available depends on your post&#8217;s status.').'</li>'.
216 216
 		'</ul>'
217
-	) );
218
-	get_current_screen()->add_help_tab( array(
217
+	));
218
+	get_current_screen()->add_help_tab(array(
219 219
 	'id'		=> 'bulk-actions',
220 220
 	'title'		=> __('Bulk Actions'),
221 221
 	'content'	=>
222
-		'<p>' . __('You can also edit or move multiple posts to the trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.') . '</p>' .
223
-				'<p>' . __('When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.') . '</p>'
224
-	) );
222
+		'<p>'.__('You can also edit or move multiple posts to the trash at once. Select the posts you want to act on using the checkboxes, then select the action you want to take from the Bulk Actions menu and click Apply.').'</p>'.
223
+				'<p>'.__('When using Bulk Edit, you can change the metadata (categories, author, etc.) for all selected posts at once. To remove a post from the grouping, just click the x next to its name in the Bulk Edit area that appears.').'</p>'
224
+	));
225 225
 
226 226
 	get_current_screen()->set_help_sidebar(
227
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
228
-	'<p>' . __('<a href="https://codex.wordpress.org/Posts_Screen">Documentation on Managing Posts</a>') . '</p>' .
229
-	'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
227
+	'<p><strong>'.__('For more information:').'</strong></p>'.
228
+	'<p>'.__('<a href="https://codex.wordpress.org/Posts_Screen">Documentation on Managing Posts</a>').'</p>'.
229
+	'<p>'.__('<a href="https://wordpress.org/support/">Support Forums</a>').'</p>'
230 230
 	);
231 231
 
232
-} elseif ( 'page' == $post_type ) {
233
-	get_current_screen()->add_help_tab( array(
232
+} elseif ('page' == $post_type) {
233
+	get_current_screen()->add_help_tab(array(
234 234
 	'id'		=> 'overview',
235 235
 	'title'		=> __('Overview'),
236 236
 	'content'	=>
237
-		'<p>' . __('Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the &#8220;Parent&#8221; of the other, creating a group of pages.') . '</p>'
238
-	) );
239
-	get_current_screen()->add_help_tab( array(
237
+		'<p>'.__('Pages are similar to posts in that they have a title, body text, and associated metadata, but they are different in that they are not part of the chronological blog stream, kind of like permanent posts. Pages are not categorized or tagged, but can have a hierarchy. You can nest pages under other pages by making one the &#8220;Parent&#8221; of the other, creating a group of pages.').'</p>'
238
+	));
239
+	get_current_screen()->add_help_tab(array(
240 240
 	'id'		=> 'managing-pages',
241 241
 	'title'		=> __('Managing Pages'),
242 242
 	'content'	=>
243
-		'<p>' . __('Managing pages is very similar to managing posts, and the screens can be customized in the same way.') . '</p>' .
244
-		'<p>' . __('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple pages at once.') . '</p>'
245
-	) );
243
+		'<p>'.__('Managing pages is very similar to managing posts, and the screens can be customized in the same way.').'</p>'.
244
+		'<p>'.__('You can also perform the same types of actions, including narrowing the list by using the filters, acting on a page using the action links that appear when you hover over a row, or using the Bulk Actions menu to edit the metadata for multiple pages at once.').'</p>'
245
+	));
246 246
 
247 247
 	get_current_screen()->set_help_sidebar(
248
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
249
-	'<p>' . __('<a href="https://codex.wordpress.org/Pages_Screen">Documentation on Managing Pages</a>') . '</p>' .
250
-	'<p>' . __('<a href="https://wordpress.org/support/">Support Forums</a>') . '</p>'
248
+	'<p><strong>'.__('For more information:').'</strong></p>'.
249
+	'<p>'.__('<a href="https://codex.wordpress.org/Pages_Screen">Documentation on Managing Pages</a>').'</p>'.
250
+	'<p>'.__('<a href="https://wordpress.org/support/">Support Forums</a>').'</p>'
251 251
 	);
252 252
 
253 253
 }
254 254
 
255
-get_current_screen()->set_screen_reader_content( array(
255
+get_current_screen()->set_screen_reader_content(array(
256 256
 	'heading_views'      => $post_type_object->labels->filter_items_list,
257 257
 	'heading_pagination' => $post_type_object->labels->items_list_navigation,
258 258
 	'heading_list'       => $post_type_object->labels->items_list,
259
-) );
259
+));
260 260
 
261
-add_screen_option( 'per_page', array( 'default' => 20, 'option' => 'edit_' . $post_type . '_per_page' ) );
261
+add_screen_option('per_page', array('default' => 20, 'option' => 'edit_'.$post_type.'_per_page'));
262 262
 
263 263
 $bulk_counts = array(
264
-	'updated'   => isset( $_REQUEST['updated'] )   ? absint( $_REQUEST['updated'] )   : 0,
265
-	'locked'    => isset( $_REQUEST['locked'] )    ? absint( $_REQUEST['locked'] )    : 0,
266
-	'deleted'   => isset( $_REQUEST['deleted'] )   ? absint( $_REQUEST['deleted'] )   : 0,
267
-	'trashed'   => isset( $_REQUEST['trashed'] )   ? absint( $_REQUEST['trashed'] )   : 0,
268
-	'untrashed' => isset( $_REQUEST['untrashed'] ) ? absint( $_REQUEST['untrashed'] ) : 0,
264
+	'updated'   => isset($_REQUEST['updated']) ? absint($_REQUEST['updated']) : 0,
265
+	'locked'    => isset($_REQUEST['locked']) ? absint($_REQUEST['locked']) : 0,
266
+	'deleted'   => isset($_REQUEST['deleted']) ? absint($_REQUEST['deleted']) : 0,
267
+	'trashed'   => isset($_REQUEST['trashed']) ? absint($_REQUEST['trashed']) : 0,
268
+	'untrashed' => isset($_REQUEST['untrashed']) ? absint($_REQUEST['untrashed']) : 0,
269 269
 );
270 270
 
271 271
 $bulk_messages = array();
272 272
 $bulk_messages['post'] = array(
273
-	'updated'   => _n( '%s post updated.', '%s posts updated.', $bulk_counts['updated'] ),
274
-	'locked'    => ( 1 == $bulk_counts['locked'] ) ? __( '1 post not updated, somebody is editing it.' ) :
275
-	                   _n( '%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked'] ),
276
-	'deleted'   => _n( '%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted'] ),
277
-	'trashed'   => _n( '%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed'] ),
278
-	'untrashed' => _n( '%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed'] ),
273
+	'updated'   => _n('%s post updated.', '%s posts updated.', $bulk_counts['updated']),
274
+	'locked'    => (1 == $bulk_counts['locked']) ? __('1 post not updated, somebody is editing it.') : _n('%s post not updated, somebody is editing it.', '%s posts not updated, somebody is editing them.', $bulk_counts['locked']),
275
+	'deleted'   => _n('%s post permanently deleted.', '%s posts permanently deleted.', $bulk_counts['deleted']),
276
+	'trashed'   => _n('%s post moved to the Trash.', '%s posts moved to the Trash.', $bulk_counts['trashed']),
277
+	'untrashed' => _n('%s post restored from the Trash.', '%s posts restored from the Trash.', $bulk_counts['untrashed']),
279 278
 );
280 279
 $bulk_messages['page'] = array(
281
-	'updated'   => _n( '%s page updated.', '%s pages updated.', $bulk_counts['updated'] ),
282
-	'locked'    => ( 1 == $bulk_counts['locked'] ) ? __( '1 page not updated, somebody is editing it.' ) :
283
-	                   _n( '%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked'] ),
284
-	'deleted'   => _n( '%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted'] ),
285
-	'trashed'   => _n( '%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed'] ),
286
-	'untrashed' => _n( '%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed'] ),
280
+	'updated'   => _n('%s page updated.', '%s pages updated.', $bulk_counts['updated']),
281
+	'locked'    => (1 == $bulk_counts['locked']) ? __('1 page not updated, somebody is editing it.') : _n('%s page not updated, somebody is editing it.', '%s pages not updated, somebody is editing them.', $bulk_counts['locked']),
282
+	'deleted'   => _n('%s page permanently deleted.', '%s pages permanently deleted.', $bulk_counts['deleted']),
283
+	'trashed'   => _n('%s page moved to the Trash.', '%s pages moved to the Trash.', $bulk_counts['trashed']),
284
+	'untrashed' => _n('%s page restored from the Trash.', '%s pages restored from the Trash.', $bulk_counts['untrashed']),
287 285
 );
288 286
 
289 287
 /**
@@ -297,24 +295,24 @@  discard block
 block discarded – undo
297 295
  *                             keyed with 'updated', 'locked', 'deleted', 'trashed', and 'untrashed'.
298 296
  * @param array $bulk_counts   Array of item counts for each message, used to build internationalized strings.
299 297
  */
300
-$bulk_messages = apply_filters( 'bulk_post_updated_messages', $bulk_messages, $bulk_counts );
301
-$bulk_counts = array_filter( $bulk_counts );
298
+$bulk_messages = apply_filters('bulk_post_updated_messages', $bulk_messages, $bulk_counts);
299
+$bulk_counts = array_filter($bulk_counts);
302 300
 
303
-require_once( ABSPATH . 'wp-admin/admin-header.php' );
301
+require_once(ABSPATH.'wp-admin/admin-header.php');
304 302
 ?>
305 303
 <div class="wrap">
306 304
 <h1 class="wp-heading-inline"><?php
307
-echo esc_html( $post_type_object->labels->name );
305
+echo esc_html($post_type_object->labels->name);
308 306
 ?></h1>
309 307
 
310 308
 <?php
311
-if ( current_user_can( $post_type_object->cap->create_posts ) ) {
312
-	echo ' <a href="' . esc_url( admin_url( $post_new_file ) ) . '" class="page-title-action">' . esc_html( $post_type_object->labels->add_new ) . '</a>';
309
+if (current_user_can($post_type_object->cap->create_posts)) {
310
+	echo ' <a href="'.esc_url(admin_url($post_new_file)).'" class="page-title-action">'.esc_html($post_type_object->labels->add_new).'</a>';
313 311
 }
314 312
 
315
-if ( isset( $_REQUEST['s'] ) && strlen( $_REQUEST['s'] ) ) {
313
+if (isset($_REQUEST['s']) && strlen($_REQUEST['s'])) {
316 314
 	/* translators: %s: search keywords */
317
-	printf( ' <span class="subtitle">' . __( 'Search results for &#8220;%s&#8221;' ) . '</span>', get_search_query() );
315
+	printf(' <span class="subtitle">'.__('Search results for &#8220;%s&#8221;').'</span>', get_search_query());
318 316
 }
319 317
 ?>
320 318
 
@@ -323,39 +321,39 @@  discard block
 block discarded – undo
323 321
 <?php
324 322
 // If we have a bulk message to issue:
325 323
 $messages = array();
326
-foreach ( $bulk_counts as $message => $count ) {
327
-	if ( isset( $bulk_messages[ $post_type ][ $message ] ) )
328
-		$messages[] = sprintf( $bulk_messages[ $post_type ][ $message ], number_format_i18n( $count ) );
329
-	elseif ( isset( $bulk_messages['post'][ $message ] ) )
330
-		$messages[] = sprintf( $bulk_messages['post'][ $message ], number_format_i18n( $count ) );
331
-
332
-	if ( $message == 'trashed' && isset( $_REQUEST['ids'] ) ) {
333
-		$ids = preg_replace( '/[^0-9,]/', '', $_REQUEST['ids'] );
334
-		$messages[] = '<a href="' . esc_url( wp_nonce_url( "edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts" ) ) . '">' . __('Undo') . '</a>';
324
+foreach ($bulk_counts as $message => $count) {
325
+	if (isset($bulk_messages[$post_type][$message]))
326
+		$messages[] = sprintf($bulk_messages[$post_type][$message], number_format_i18n($count));
327
+	elseif (isset($bulk_messages['post'][$message]))
328
+		$messages[] = sprintf($bulk_messages['post'][$message], number_format_i18n($count));
329
+
330
+	if ($message == 'trashed' && isset($_REQUEST['ids'])) {
331
+		$ids = preg_replace('/[^0-9,]/', '', $_REQUEST['ids']);
332
+		$messages[] = '<a href="'.esc_url(wp_nonce_url("edit.php?post_type=$post_type&doaction=undo&action=untrash&ids=$ids", "bulk-posts")).'">'.__('Undo').'</a>';
335 333
 	}
336 334
 }
337 335
 
338
-if ( $messages )
339
-	echo '<div id="message" class="updated notice is-dismissible"><p>' . join( ' ', $messages ) . '</p></div>';
340
-unset( $messages );
336
+if ($messages)
337
+	echo '<div id="message" class="updated notice is-dismissible"><p>'.join(' ', $messages).'</p></div>';
338
+unset($messages);
341 339
 
342
-$_SERVER['REQUEST_URI'] = remove_query_arg( array( 'locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed' ), $_SERVER['REQUEST_URI'] );
340
+$_SERVER['REQUEST_URI'] = remove_query_arg(array('locked', 'skipped', 'updated', 'deleted', 'trashed', 'untrashed'), $_SERVER['REQUEST_URI']);
343 341
 ?>
344 342
 
345 343
 <?php $wp_list_table->views(); ?>
346 344
 
347 345
 <form id="posts-filter" method="get">
348 346
 
349
-<?php $wp_list_table->search_box( $post_type_object->labels->search_items, 'post' ); ?>
347
+<?php $wp_list_table->search_box($post_type_object->labels->search_items, 'post'); ?>
350 348
 
351
-<input type="hidden" name="post_status" class="post_status_page" value="<?php echo !empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
349
+<input type="hidden" name="post_status" class="post_status_page" value="<?php echo ! empty($_REQUEST['post_status']) ? esc_attr($_REQUEST['post_status']) : 'all'; ?>" />
352 350
 <input type="hidden" name="post_type" class="post_type_page" value="<?php echo $post_type; ?>" />
353 351
 
354
-<?php if ( ! empty( $_REQUEST['author'] ) ) { ?>
355
-<input type="hidden" name="author" value="<?php echo esc_attr( $_REQUEST['author'] ); ?>" />
352
+<?php if ( ! empty($_REQUEST['author'])) { ?>
353
+<input type="hidden" name="author" value="<?php echo esc_attr($_REQUEST['author']); ?>" />
356 354
 <?php } ?>
357 355
 
358
-<?php if ( ! empty( $_REQUEST['show_sticky'] ) ) { ?>
356
+<?php if ( ! empty($_REQUEST['show_sticky'])) { ?>
359 357
 <input type="hidden" name="show_sticky" value="1" />
360 358
 <?php } ?>
361 359
 
@@ -364,7 +362,7 @@  discard block
 block discarded – undo
364 362
 </form>
365 363
 
366 364
 <?php
367
-if ( $wp_list_table->has_items() )
365
+if ($wp_list_table->has_items())
368 366
 	$wp_list_table->inline_edit();
369 367
 ?>
370 368
 
@@ -373,4 +371,4 @@  discard block
 block discarded – undo
373 371
 </div>
374 372
 
375 373
 <?php
376
-include( ABSPATH . 'wp-admin/admin-footer.php' );
374
+include(ABSPATH.'wp-admin/admin-footer.php');
Please login to merge, or discard this patch.
src/wp-admin/post-new.php 2 patches
Braces   +9 added lines, -6 removed lines patch added patch discarded remove patch
@@ -29,9 +29,10 @@  discard block
 block discarded – undo
29 29
 	$parent_file = 'edit.php';
30 30
 	$submenu_file = 'post-new.php';
31 31
 } elseif ( 'attachment' == $post_type ) {
32
-	if ( wp_redirect( admin_url( 'media-new.php' ) ) )
33
-		exit;
34
-} else {
32
+	if ( wp_redirect( admin_url( 'media-new.php' ) ) ) {
33
+			exit;
34
+	}
35
+	} else {
35 36
 	$submenu_file = "post-new.php?post_type=$post_type";
36 37
 	if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) {
37 38
 		$parent_file = $post_type_object->show_in_menu;
@@ -63,8 +64,9 @@  discard block
 block discarded – undo
63 64
 }
64 65
 
65 66
 // Schedule auto-draft cleanup
66
-if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
67
+if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) ) {
67 68
 	wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
69
+}
68 70
 
69 71
 wp_enqueue_script( 'autosave' );
70 72
 
@@ -73,8 +75,9 @@  discard block
 block discarded – undo
73 75
 } else {
74 76
 	$check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) );
75 77
 
76
-	if ( count( $check_users ) > 1 )
77
-		add_action( 'admin_footer', '_admin_notice_post_locked' );
78
+	if ( count( $check_users ) > 1 ) {
79
+			add_action( 'admin_footer', '_admin_notice_post_locked' );
80
+	}
78 81
 
79 82
 	unset( $check_users );
80 83
 }
Please login to merge, or discard this patch.
Spacing   +26 added lines, -26 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
  */
8 8
 
9 9
 /** Load WordPress Administration Bootstrap */
10
-require_once( dirname( __FILE__ ) . '/admin.php' );
10
+require_once(dirname(__FILE__).'/admin.php');
11 11
 
12 12
 /**
13 13
  * @global string  $post_type
@@ -16,28 +16,28 @@  discard block
 block discarded – undo
16 16
  */
17 17
 global $post_type, $post_type_object, $post;
18 18
 
19
-if ( ! isset( $_GET['post_type'] ) ) {
19
+if ( ! isset($_GET['post_type'])) {
20 20
 	$post_type = 'post';
21
-} elseif ( in_array( $_GET['post_type'], get_post_types( array('show_ui' => true ) ) ) ) {
21
+} elseif (in_array($_GET['post_type'], get_post_types(array('show_ui' => true)))) {
22 22
 	$post_type = $_GET['post_type'];
23 23
 } else {
24
-	wp_die( __( 'Invalid post type.' ) );
24
+	wp_die(__('Invalid post type.'));
25 25
 }
26
-$post_type_object = get_post_type_object( $post_type );
26
+$post_type_object = get_post_type_object($post_type);
27 27
 
28
-if ( 'post' == $post_type ) {
28
+if ('post' == $post_type) {
29 29
 	$parent_file = 'edit.php';
30 30
 	$submenu_file = 'post-new.php';
31
-} elseif ( 'attachment' == $post_type ) {
32
-	if ( wp_redirect( admin_url( 'media-new.php' ) ) )
31
+} elseif ('attachment' == $post_type) {
32
+	if (wp_redirect(admin_url('media-new.php')))
33 33
 		exit;
34 34
 } else {
35 35
 	$submenu_file = "post-new.php?post_type=$post_type";
36
-	if ( isset( $post_type_object ) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true ) {
36
+	if (isset($post_type_object) && $post_type_object->show_in_menu && $post_type_object->show_in_menu !== true) {
37 37
 		$parent_file = $post_type_object->show_in_menu;
38 38
 		// What if there isn't a post-new.php item for this post type?
39
-		if ( ! isset( $_registered_pages[ get_plugin_page_hookname( "post-new.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) {
40
-			if (	isset( $_registered_pages[ get_plugin_page_hookname( "edit.php?post_type=$post_type", $post_type_object->show_in_menu ) ] ) ) {
39
+		if ( ! isset($_registered_pages[get_plugin_page_hookname("post-new.php?post_type=$post_type", $post_type_object->show_in_menu)])) {
40
+			if (isset($_registered_pages[get_plugin_page_hookname("edit.php?post_type=$post_type", $post_type_object->show_in_menu)])) {
41 41
 				// Fall back to edit.php for that post type, if it exists
42 42
 				$submenu_file = "edit.php?post_type=$post_type";
43 43
 			} else {
@@ -54,33 +54,33 @@  discard block
 block discarded – undo
54 54
 
55 55
 $editing = true;
56 56
 
57
-if ( ! current_user_can( $post_type_object->cap->edit_posts ) || ! current_user_can( $post_type_object->cap->create_posts ) ) {
57
+if ( ! current_user_can($post_type_object->cap->edit_posts) || ! current_user_can($post_type_object->cap->create_posts)) {
58 58
 	wp_die(
59
-		'<h1>' . __( 'Cheatin&#8217; uh?' ) . '</h1>' .
60
-		'<p>' . __( 'Sorry, you are not allowed to create posts as this user.' ) . '</p>',
59
+		'<h1>'.__('Cheatin&#8217; uh?').'</h1>'.
60
+		'<p>'.__('Sorry, you are not allowed to create posts as this user.').'</p>',
61 61
 		403
62 62
 	);
63 63
 }
64 64
 
65 65
 // Schedule auto-draft cleanup
66
-if ( ! wp_next_scheduled( 'wp_scheduled_auto_draft_delete' ) )
67
-	wp_schedule_event( time(), 'daily', 'wp_scheduled_auto_draft_delete' );
66
+if ( ! wp_next_scheduled('wp_scheduled_auto_draft_delete'))
67
+	wp_schedule_event(time(), 'daily', 'wp_scheduled_auto_draft_delete');
68 68
 
69
-wp_enqueue_script( 'autosave' );
69
+wp_enqueue_script('autosave');
70 70
 
71
-if ( is_multisite() ) {
72
-	add_action( 'admin_footer', '_admin_notice_post_locked' );
71
+if (is_multisite()) {
72
+	add_action('admin_footer', '_admin_notice_post_locked');
73 73
 } else {
74
-	$check_users = get_users( array( 'fields' => 'ID', 'number' => 2 ) );
74
+	$check_users = get_users(array('fields' => 'ID', 'number' => 2));
75 75
 
76
-	if ( count( $check_users ) > 1 )
77
-		add_action( 'admin_footer', '_admin_notice_post_locked' );
76
+	if (count($check_users) > 1)
77
+		add_action('admin_footer', '_admin_notice_post_locked');
78 78
 
79
-	unset( $check_users );
79
+	unset($check_users);
80 80
 }
81 81
 
82 82
 // Show post form.
83
-$post = get_default_post_to_edit( $post_type, true );
83
+$post = get_default_post_to_edit($post_type, true);
84 84
 $post_ID = $post->ID;
85
-include( ABSPATH . 'wp-admin/edit-form-advanced.php' );
86
-include( ABSPATH . 'wp-admin/admin-footer.php' );
85
+include(ABSPATH.'wp-admin/edit-form-advanced.php');
86
+include(ABSPATH.'wp-admin/admin-footer.php');
Please login to merge, or discard this patch.
src/wp-admin/network/site-info.php 2 patches
Braces   +5 added lines, -2 removed lines patch added patch discarded remove patch
@@ -177,9 +177,12 @@
 block discarded – undo
177 177
 		</tr>
178 178
 		<?php
179 179
 		// For any other site, the scheme, domain, and path can all be changed.
180
-		else : ?>
180
+		else {
181
+			: ?>
181 182
 		<tr class="form-field form-required">
182
-			<th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
183
+			<th scope="row"><?php _e( 'Site Address (URL)' );
184
+		}
185
+		?></th>
183 186
 			<td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>
184 187
 		</tr>
185 188
 		<?php endif; ?>
Please login to merge, or discard this patch.
Spacing   +87 added lines, -87 removed lines patch added patch discarded remove patch
@@ -8,74 +8,74 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 /** Load WordPress Administration Bootstrap */
11
-require_once( dirname( __FILE__ ) . '/admin.php' );
11
+require_once(dirname(__FILE__).'/admin.php');
12 12
 
13
-if ( ! current_user_can( 'manage_sites' ) ) {
14
-	wp_die( __( 'Sorry, you are not allowed to edit this site.' ) );
13
+if ( ! current_user_can('manage_sites')) {
14
+	wp_die(__('Sorry, you are not allowed to edit this site.'));
15 15
 }
16 16
 
17
-get_current_screen()->add_help_tab( array(
17
+get_current_screen()->add_help_tab(array(
18 18
 	'id'      => 'overview',
19
-	'title'   => __( 'Overview' ),
19
+	'title'   => __('Overview'),
20 20
 	'content' =>
21
-		'<p>' . __( 'The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.' ) . '</p>' .
22
-		'<p>' . __( '<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.' ) . '</p>' .
23
-		'<p>' . __( '<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.' ) . '</p>' .
24
-		'<p>' . sprintf( __( '<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.' ), network_admin_url( 'themes.php' ) ) . '</p>' .
25
-		'<p>' . __( '<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.' ) . '</p>'
26
-) );
21
+		'<p>'.__('The menu is for editing information specific to individual sites, particularly if the admin area of a site is unavailable.').'</p>'.
22
+		'<p>'.__('<strong>Info</strong> &mdash; The site URL is rarely edited as this can cause the site to not work properly. The Registered date and Last Updated date are displayed. Network admins can mark a site as archived, spam, deleted and mature, to remove from public listings or disable.').'</p>'.
23
+		'<p>'.__('<strong>Users</strong> &mdash; This displays the users associated with this site. You can also change their role, reset their password, or remove them from the site. Removing the user from the site does not remove the user from the network.').'</p>'.
24
+		'<p>'.sprintf(__('<strong>Themes</strong> &mdash; This area shows themes that are not already enabled across the network. Enabling a theme in this menu makes it accessible to this site. It does not activate the theme, but allows it to show in the site&#8217;s Appearance menu. To enable a theme for the entire network, see the <a href="%s">Network Themes</a> screen.'), network_admin_url('themes.php')).'</p>'.
25
+		'<p>'.__('<strong>Settings</strong> &mdash; This page shows a list of all settings associated with this site. Some are created by WordPress and others are created by plugins you activate. Note that some fields are grayed out and say Serialized Data. You cannot modify these values due to the way the setting is stored in the database.').'</p>'
26
+));
27 27
 
28 28
 get_current_screen()->set_help_sidebar(
29
-	'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
30
-	'<p>' . __( '<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>' ) . '</p>' .
31
-	'<p>' . __( '<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>' ) . '</p>'
29
+	'<p><strong>'.__('For more information:').'</strong></p>'.
30
+	'<p>'.__('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>').'</p>'.
31
+	'<p>'.__('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>').'</p>'
32 32
 );
33 33
 
34
-$id = isset( $_REQUEST['id'] ) ? intval( $_REQUEST['id'] ) : 0;
34
+$id = isset($_REQUEST['id']) ? intval($_REQUEST['id']) : 0;
35 35
 
36
-if ( ! $id ) {
37
-	wp_die( __('Invalid site ID.') );
36
+if ( ! $id) {
37
+	wp_die(__('Invalid site ID.'));
38 38
 }
39 39
 
40
-$details = get_site( $id );
41
-if ( ! $details ) {
42
-	wp_die( __( 'The requested site does not exist.' ) );
40
+$details = get_site($id);
41
+if ( ! $details) {
42
+	wp_die(__('The requested site does not exist.'));
43 43
 }
44 44
 
45
-if ( ! can_edit_network( $details->site_id ) ) {
46
-	wp_die( __( 'Sorry, you are not allowed to access this page.' ), 403 );
45
+if ( ! can_edit_network($details->site_id)) {
46
+	wp_die(__('Sorry, you are not allowed to access this page.'), 403);
47 47
 }
48 48
 
49
-$parsed_scheme = parse_url( $details->siteurl, PHP_URL_SCHEME );
50
-$is_main_site = is_main_site( $id );
49
+$parsed_scheme = parse_url($details->siteurl, PHP_URL_SCHEME);
50
+$is_main_site = is_main_site($id);
51 51
 
52
-if ( isset( $_REQUEST['action'] ) && 'update-site' == $_REQUEST['action'] ) {
53
-	check_admin_referer( 'edit-site' );
52
+if (isset($_REQUEST['action']) && 'update-site' == $_REQUEST['action']) {
53
+	check_admin_referer('edit-site');
54 54
 
55
-	switch_to_blog( $id );
55
+	switch_to_blog($id);
56 56
 
57 57
 	// Rewrite rules can't be flushed during switch to blog.
58
-	delete_option( 'rewrite_rules' );
58
+	delete_option('rewrite_rules');
59 59
 
60
-	$blog_data = wp_unslash( $_POST['blog'] );
60
+	$blog_data = wp_unslash($_POST['blog']);
61 61
 	$blog_data['scheme'] = $parsed_scheme;
62 62
 
63
-	if ( $is_main_site ) {
63
+	if ($is_main_site) {
64 64
 		// On the network's main site, don't allow the domain or path to change.
65 65
 		$blog_data['domain'] = $details->domain;
66 66
 		$blog_data['path'] = $details->path;
67 67
 	} else {
68 68
 		// For any other site, the scheme, domain, and path can all be changed. We first
69 69
 		// need to ensure a scheme has been provided, otherwise fallback to the existing.
70
-		$new_url_scheme = parse_url( $blog_data['url'], PHP_URL_SCHEME );
70
+		$new_url_scheme = parse_url($blog_data['url'], PHP_URL_SCHEME);
71 71
 
72
-		if ( ! $new_url_scheme ) {
73
-			$blog_data['url'] = esc_url( $parsed_scheme . '://' . $blog_data['url'] );
72
+		if ( ! $new_url_scheme) {
73
+			$blog_data['url'] = esc_url($parsed_scheme.'://'.$blog_data['url']);
74 74
 		}
75
-		$update_parsed_url = parse_url( $blog_data['url'] );
75
+		$update_parsed_url = parse_url($blog_data['url']);
76 76
 
77 77
 		// If a path is not provided, use the default of `/`.
78
-		if ( ! isset( $update_parsed_url['path'] ) ) {
78
+		if ( ! isset($update_parsed_url['path'])) {
79 79
 			$update_parsed_url['path'] = '/';
80 80
 		}
81 81
 
@@ -84,119 +84,119 @@  discard block
 block discarded – undo
84 84
 		$blog_data['path'] = $update_parsed_url['path'];
85 85
 	}
86 86
 
87
-	$existing_details = get_site( $id );
88
-	$blog_data_checkboxes = array( 'public', 'archived', 'spam', 'mature', 'deleted' );
89
-	foreach ( $blog_data_checkboxes as $c ) {
90
-		if ( ! in_array( $existing_details->$c, array( 0, 1 ) ) ) {
91
-			$blog_data[ $c ] = $existing_details->$c;
87
+	$existing_details = get_site($id);
88
+	$blog_data_checkboxes = array('public', 'archived', 'spam', 'mature', 'deleted');
89
+	foreach ($blog_data_checkboxes as $c) {
90
+		if ( ! in_array($existing_details->$c, array(0, 1))) {
91
+			$blog_data[$c] = $existing_details->$c;
92 92
 		} else {
93
-			$blog_data[ $c ] = isset( $_POST['blog'][ $c ] ) ? 1 : 0;
93
+			$blog_data[$c] = isset($_POST['blog'][$c]) ? 1 : 0;
94 94
 		}
95 95
 	}
96 96
 
97
-	update_blog_details( $id, $blog_data );
97
+	update_blog_details($id, $blog_data);
98 98
 
99 99
 	// Maybe update home and siteurl options.
100
-	$new_details = get_site( $id );
100
+	$new_details = get_site($id);
101 101
 
102
-	$old_home_url = trailingslashit( esc_url( get_option( 'home' ) ) );
103
-	$old_home_parsed = parse_url( $old_home_url );
102
+	$old_home_url = trailingslashit(esc_url(get_option('home')));
103
+	$old_home_parsed = parse_url($old_home_url);
104 104
 
105
-	if ( $old_home_parsed['host'] === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path ) {
106
-		$new_home_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
107
-		update_option( 'home', $new_home_url );
105
+	if ($old_home_parsed['host'] === $existing_details->domain && $old_home_parsed['path'] === $existing_details->path) {
106
+		$new_home_url = untrailingslashit(esc_url_raw($blog_data['scheme'].'://'.$new_details->domain.$new_details->path));
107
+		update_option('home', $new_home_url);
108 108
 	}
109 109
 
110
-	$old_site_url = trailingslashit( esc_url( get_option( 'siteurl' ) ) );
111
-	$old_site_parsed = parse_url( $old_site_url );
110
+	$old_site_url = trailingslashit(esc_url(get_option('siteurl')));
111
+	$old_site_parsed = parse_url($old_site_url);
112 112
 
113
-	if ( $old_site_parsed['host'] === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path ) {
114
-		$new_site_url = untrailingslashit( esc_url_raw( $blog_data['scheme'] . '://' . $new_details->domain . $new_details->path ) );
115
-		update_option( 'siteurl', $new_site_url );
113
+	if ($old_site_parsed['host'] === $existing_details->domain && $old_site_parsed['path'] === $existing_details->path) {
114
+		$new_site_url = untrailingslashit(esc_url_raw($blog_data['scheme'].'://'.$new_details->domain.$new_details->path));
115
+		update_option('siteurl', $new_site_url);
116 116
 	}
117 117
 
118 118
 	restore_current_blog();
119
-	wp_redirect( add_query_arg( array( 'update' => 'updated', 'id' => $id ), 'site-info.php' ) );
119
+	wp_redirect(add_query_arg(array('update' => 'updated', 'id' => $id), 'site-info.php'));
120 120
 	exit;
121 121
 }
122 122
 
123
-if ( isset( $_GET['update'] ) ) {
123
+if (isset($_GET['update'])) {
124 124
 	$messages = array();
125
-	if ( 'updated' == $_GET['update'] ) {
126
-		$messages[] = __( 'Site info updated.' );
125
+	if ('updated' == $_GET['update']) {
126
+		$messages[] = __('Site info updated.');
127 127
 	}
128 128
 }
129 129
 
130 130
 /* translators: %s: site name */
131
-$title = sprintf( __( 'Edit Site: %s' ), esc_html( $details->blogname ) );
131
+$title = sprintf(__('Edit Site: %s'), esc_html($details->blogname));
132 132
 
133 133
 $parent_file = 'sites.php';
134 134
 $submenu_file = 'sites.php';
135 135
 
136
-require( ABSPATH . 'wp-admin/admin-header.php' );
136
+require(ABSPATH.'wp-admin/admin-header.php');
137 137
 
138 138
 ?>
139 139
 
140 140
 <div class="wrap">
141 141
 <h1 id="edit-site"><?php echo $title; ?></h1>
142
-<p class="edit-site-actions"><a href="<?php echo esc_url( get_home_url( $id, '/' ) ); ?>"><?php _e( 'Visit' ); ?></a> | <a href="<?php echo esc_url( get_admin_url( $id ) ); ?>"><?php _e( 'Dashboard' ); ?></a></p>
142
+<p class="edit-site-actions"><a href="<?php echo esc_url(get_home_url($id, '/')); ?>"><?php _e('Visit'); ?></a> | <a href="<?php echo esc_url(get_admin_url($id)); ?>"><?php _e('Dashboard'); ?></a></p>
143 143
 <?php
144 144
 
145
-network_edit_site_nav( array(
145
+network_edit_site_nav(array(
146 146
 	'blog_id'  => $id,
147 147
 	'selected' => 'site-info'
148
-) );
148
+));
149 149
 
150
-if ( ! empty( $messages ) ) {
151
-	foreach ( $messages as $msg ) {
152
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
150
+if ( ! empty($messages)) {
151
+	foreach ($messages as $msg) {
152
+		echo '<div id="message" class="updated notice is-dismissible"><p>'.$msg.'</p></div>';
153 153
 	}
154 154
 }
155 155
 ?>
156 156
 <form method="post" action="site-info.php?action=update-site">
157
-	<?php wp_nonce_field( 'edit-site' ); ?>
158
-	<input type="hidden" name="id" value="<?php echo esc_attr( $id ) ?>" />
157
+	<?php wp_nonce_field('edit-site'); ?>
158
+	<input type="hidden" name="id" value="<?php echo esc_attr($id) ?>" />
159 159
 	<table class="form-table">
160 160
 		<?php
161 161
 		// The main site of the network should not be updated on this page.
162
-		if ( $is_main_site ) : ?>
162
+		if ($is_main_site) : ?>
163 163
 		<tr class="form-field">
164
-			<th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
165
-			<td><?php echo esc_url( $parsed_scheme . '://' . $details->domain . $details->path ); ?></td>
164
+			<th scope="row"><?php _e('Site Address (URL)'); ?></th>
165
+			<td><?php echo esc_url($parsed_scheme.'://'.$details->domain.$details->path); ?></td>
166 166
 		</tr>
167 167
 		<?php
168 168
 		// For any other site, the scheme, domain, and path can all be changed.
169 169
 		else : ?>
170 170
 		<tr class="form-field form-required">
171
-			<th scope="row"><?php _e( 'Site Address (URL)' ); ?></th>
172
-			<td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme . '://' . esc_attr( $details->domain ) . esc_attr( $details->path ); ?>" /></td>
171
+			<th scope="row"><?php _e('Site Address (URL)'); ?></th>
172
+			<td><input name="blog[url]" type="text" id="url" value="<?php echo $parsed_scheme.'://'.esc_attr($details->domain).esc_attr($details->path); ?>" /></td>
173 173
 		</tr>
174 174
 		<?php endif; ?>
175 175
 
176 176
 		<tr class="form-field">
177
-			<th scope="row"><label for="blog_registered"><?php _ex( 'Registered', 'site' ) ?></label></th>
178
-			<td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr( $details->registered ) ?>" /></td>
177
+			<th scope="row"><label for="blog_registered"><?php _ex('Registered', 'site') ?></label></th>
178
+			<td><input name="blog[registered]" type="text" id="blog_registered" value="<?php echo esc_attr($details->registered) ?>" /></td>
179 179
 		</tr>
180 180
 		<tr class="form-field">
181
-			<th scope="row"><label for="blog_last_updated"><?php _e( 'Last Updated' ); ?></label></th>
182
-			<td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr( $details->last_updated ) ?>" /></td>
181
+			<th scope="row"><label for="blog_last_updated"><?php _e('Last Updated'); ?></label></th>
182
+			<td><input name="blog[last_updated]" type="text" id="blog_last_updated" value="<?php echo esc_attr($details->last_updated) ?>" /></td>
183 183
 		</tr>
184 184
 		<?php
185
-		$attribute_fields = array( 'public' => __( 'Public' ) );
186
-		if ( ! $is_main_site ) {
187
-			$attribute_fields['archived'] = __( 'Archived' );
188
-			$attribute_fields['spam']     = _x( 'Spam', 'site' );
189
-			$attribute_fields['deleted']  = __( 'Deleted' );
185
+		$attribute_fields = array('public' => __('Public'));
186
+		if ( ! $is_main_site) {
187
+			$attribute_fields['archived'] = __('Archived');
188
+			$attribute_fields['spam']     = _x('Spam', 'site');
189
+			$attribute_fields['deleted']  = __('Deleted');
190 190
 		}
191
-		$attribute_fields['mature'] = __( 'Mature' );
191
+		$attribute_fields['mature'] = __('Mature');
192 192
 		?>
193 193
 		<tr>
194
-			<th scope="row"><?php _e( 'Attributes' ); ?></th>
194
+			<th scope="row"><?php _e('Attributes'); ?></th>
195 195
 			<td>
196 196
 			<fieldset>
197
-			<legend class="screen-reader-text"><?php _e( 'Set site attributes' ) ?></legend>
198
-			<?php foreach ( $attribute_fields as $field_key => $field_label ) : ?>
199
-				<label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked( (bool) $details->$field_key, true ); disabled( ! in_array( $details->$field_key, array( 0, 1 ) ) ); ?> />
197
+			<legend class="screen-reader-text"><?php _e('Set site attributes') ?></legend>
198
+			<?php foreach ($attribute_fields as $field_key => $field_label) : ?>
199
+				<label><input type="checkbox" name="blog[<?php echo $field_key; ?>]" value="1" <?php checked((bool) $details->$field_key, true); disabled( ! in_array($details->$field_key, array(0, 1))); ?> />
200 200
 				<?php echo $field_label; ?></label><br/>
201 201
 			<?php endforeach; ?>
202 202
 			<fieldset>
@@ -208,4 +208,4 @@  discard block
 block discarded – undo
208 208
 
209 209
 </div>
210 210
 <?php
211
-require( ABSPATH . 'wp-admin/admin-footer.php' );
211
+require(ABSPATH.'wp-admin/admin-footer.php');
Please login to merge, or discard this patch.
src/wp-admin/network/site-new.php 3 patches
Indentation   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -115,12 +115,12 @@
 block discarded – undo
115 115
 		}
116 116
 
117 117
 		/**
118
-		  * Fires after a new user has been created via the network site-new.php page.
119
-		  *
120
-		  * @since 4.4.0
121
-		  *
122
-		  * @param int $user_id ID of the newly created user.
123
-		  */
118
+		 * Fires after a new user has been created via the network site-new.php page.
119
+		 *
120
+		 * @since 4.4.0
121
+		 *
122
+		 * @param int $user_id ID of the newly created user.
123
+		 */
124 124
 		do_action( 'network_site_new_created_user', $user_id );
125 125
 	}
126 126
 
Please login to merge, or discard this patch.
Spacing   +90 added lines, -90 removed lines patch added patch discarded remove patch
@@ -8,49 +8,49 @@  discard block
 block discarded – undo
8 8
  */
9 9
 
10 10
 /** Load WordPress Administration Bootstrap */
11
-require_once( dirname( __FILE__ ) . '/admin.php' );
11
+require_once(dirname(__FILE__).'/admin.php');
12 12
 
13 13
 /** WordPress Translation Install API */
14
-require_once( ABSPATH . 'wp-admin/includes/translation-install.php' );
14
+require_once(ABSPATH.'wp-admin/includes/translation-install.php');
15 15
 
16
-if ( ! current_user_can( 'create_sites' ) ) {
17
-	wp_die( __( 'Sorry, you are not allowed to add sites to this network.' ) );
16
+if ( ! current_user_can('create_sites')) {
17
+	wp_die(__('Sorry, you are not allowed to add sites to this network.'));
18 18
 }
19 19
 
20
-get_current_screen()->add_help_tab( array(
20
+get_current_screen()->add_help_tab(array(
21 21
 	'id'      => 'overview',
22 22
 	'title'   => __('Overview'),
23 23
 	'content' =>
24
-		'<p>' . __('This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.') . '</p>' .
25
-		'<p>' . __('If the admin email for the new site does not exist in the database, a new user will also be created.') . '</p>'
26
-) );
24
+		'<p>'.__('This screen is for Super Admins to add new sites to the network. This is not affected by the registration settings.').'</p>'.
25
+		'<p>'.__('If the admin email for the new site does not exist in the database, a new user will also be created.').'</p>'
26
+));
27 27
 
28 28
 get_current_screen()->set_help_sidebar(
29
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
30
-	'<p>' . __('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>') . '</p>' .
31
-	'<p>' . __('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>') . '</p>'
29
+	'<p><strong>'.__('For more information:').'</strong></p>'.
30
+	'<p>'.__('<a href="https://codex.wordpress.org/Network_Admin_Sites_Screen">Documentation on Site Management</a>').'</p>'.
31
+	'<p>'.__('<a href="https://wordpress.org/support/forum/multisite/">Support Forums</a>').'</p>'
32 32
 );
33 33
 
34
-if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
35
-	check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
34
+if (isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action']) {
35
+	check_admin_referer('add-blog', '_wpnonce_add-blog');
36 36
 
37
-	if ( ! is_array( $_POST['blog'] ) )
38
-		wp_die( __( 'Can&#8217;t create an empty site.' ) );
37
+	if ( ! is_array($_POST['blog']))
38
+		wp_die(__('Can&#8217;t create an empty site.'));
39 39
 
40 40
 	$blog = $_POST['blog'];
41 41
 	$domain = '';
42
-	if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
43
-		$domain = strtolower( $blog['domain'] );
42
+	if (preg_match('|^([a-zA-Z0-9-])+$|', $blog['domain']))
43
+		$domain = strtolower($blog['domain']);
44 44
 
45 45
 	// If not a subdomain install, make sure the domain isn't a reserved word
46
-	if ( ! is_subdomain_install() ) {
46
+	if ( ! is_subdomain_install()) {
47 47
 		$subdirectory_reserved_names = get_subdirectory_reserved_names();
48 48
 
49
-		if ( in_array( $domain, $subdirectory_reserved_names ) ) {
49
+		if (in_array($domain, $subdirectory_reserved_names)) {
50 50
 			wp_die(
51 51
 				/* translators: %s: reserved names list */
52
-				sprintf( __( 'The following words are reserved for use by WordPress functions and cannot be used as blog names: %s' ),
53
-					'<code>' . implode( '</code>, <code>', $subdirectory_reserved_names ) . '</code>'
52
+				sprintf(__('The following words are reserved for use by WordPress functions and cannot be used as blog names: %s'),
53
+					'<code>'.implode('</code>, <code>', $subdirectory_reserved_names).'</code>'
54 54
 				)
55 55
 			);
56 56
 		}
@@ -63,40 +63,40 @@  discard block
 block discarded – undo
63 63
 	);
64 64
 
65 65
 	// Handle translation install for the new site.
66
-	if ( isset( $_POST['WPLANG'] ) ) {
67
-		if ( '' === $_POST['WPLANG'] ) {
66
+	if (isset($_POST['WPLANG'])) {
67
+		if ('' === $_POST['WPLANG']) {
68 68
 			$meta['WPLANG'] = ''; // en_US
69
-		} elseif ( wp_can_install_language_pack() ) {
70
-			$language = wp_download_language_pack( wp_unslash( $_POST['WPLANG'] ) );
71
-			if ( $language ) {
69
+		} elseif (wp_can_install_language_pack()) {
70
+			$language = wp_download_language_pack(wp_unslash($_POST['WPLANG']));
71
+			if ($language) {
72 72
 				$meta['WPLANG'] = $language;
73 73
 			}
74 74
 		}
75 75
 	}
76 76
 
77
-	if ( empty( $domain ) )
78
-		wp_die( __( 'Missing or invalid site address.' ) );
77
+	if (empty($domain))
78
+		wp_die(__('Missing or invalid site address.'));
79 79
 
80
-	if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
81
-		wp_die( __( 'Missing email address.' ) );
80
+	if (isset($blog['email']) && '' === trim($blog['email'])) {
81
+		wp_die(__('Missing email address.'));
82 82
 	}
83 83
 
84
-	$email = sanitize_email( $blog['email'] );
85
-	if ( ! is_email( $email ) ) {
86
-		wp_die( __( 'Invalid email address.' ) );
84
+	$email = sanitize_email($blog['email']);
85
+	if ( ! is_email($email)) {
86
+		wp_die(__('Invalid email address.'));
87 87
 	}
88 88
 
89
-	if ( is_subdomain_install() ) {
90
-		$newdomain = $domain . '.' . preg_replace( '|^www\.|', '', get_network()->domain );
89
+	if (is_subdomain_install()) {
90
+		$newdomain = $domain.'.'.preg_replace('|^www\.|', '', get_network()->domain);
91 91
 		$path      = get_network()->path;
92 92
 	} else {
93 93
 		$newdomain = get_network()->domain;
94
-		$path      = get_network()->path . $domain . '/';
94
+		$path      = get_network()->path.$domain.'/';
95 95
 	}
96 96
 
97 97
 	$password = 'N/A';
98 98
 	$user_id = email_exists($email);
99
-	if ( !$user_id ) { // Create a new user with a random password
99
+	if ( ! $user_id) { // Create a new user with a random password
100 100
 		/**
101 101
 		 * Fires immediately before a new user is created via the network site-new.php page.
102 102
 		 *
@@ -104,16 +104,16 @@  discard block
 block discarded – undo
104 104
 		 *
105 105
 		 * @param string $email Email of the non-existent user.
106 106
 		 */
107
-		do_action( 'pre_network_site_new_created_user', $email );
107
+		do_action('pre_network_site_new_created_user', $email);
108 108
 
109
-		$user_id = username_exists( $domain );
110
-		if ( $user_id ) {
111
-			wp_die( __( 'The domain or path entered conflicts with an existing username.' ) );
109
+		$user_id = username_exists($domain);
110
+		if ($user_id) {
111
+			wp_die(__('The domain or path entered conflicts with an existing username.'));
112 112
 		}
113
-		$password = wp_generate_password( 12, false );
114
-		$user_id = wpmu_create_user( $domain, $password, $email );
115
-		if ( false === $user_id ) {
116
-			wp_die( __( 'There was an error creating the user.' ) );
113
+		$password = wp_generate_password(12, false);
114
+		$user_id = wpmu_create_user($domain, $password, $email);
115
+		if (false === $user_id) {
116
+			wp_die(__('There was an error creating the user.'));
117 117
 		}
118 118
 
119 119
 		/**
@@ -123,129 +123,129 @@  discard block
 block discarded – undo
123 123
 		  *
124 124
 		  * @param int $user_id ID of the newly created user.
125 125
 		  */
126
-		do_action( 'network_site_new_created_user', $user_id );
126
+		do_action('network_site_new_created_user', $user_id);
127 127
 	}
128 128
 
129 129
 	$wpdb->hide_errors();
130
-	$id = wpmu_create_blog( $newdomain, $path, $title, $user_id, $meta, get_current_network_id() );
130
+	$id = wpmu_create_blog($newdomain, $path, $title, $user_id, $meta, get_current_network_id());
131 131
 	$wpdb->show_errors();
132
-	if ( ! is_wp_error( $id ) ) {
133
-		if ( ! is_super_admin( $user_id ) && !get_user_option( 'primary_blog', $user_id ) ) {
134
-			update_user_option( $user_id, 'primary_blog', $id, true );
132
+	if ( ! is_wp_error($id)) {
133
+		if ( ! is_super_admin($user_id) && ! get_user_option('primary_blog', $user_id)) {
134
+			update_user_option($user_id, 'primary_blog', $id, true);
135 135
 		}
136 136
 
137 137
 		wp_mail(
138
-			get_site_option( 'admin_email' ),
138
+			get_site_option('admin_email'),
139 139
 			sprintf(
140 140
 				/* translators: %s: network name */
141
-				__( '[%s] New Site Created' ),
141
+				__('[%s] New Site Created'),
142 142
 				get_network()->site_name
143 143
 			),
144 144
 			sprintf(
145 145
 				/* translators: 1: user login, 2: site url, 3: site name/title */
146
-				__( 'New site created by %1$s
146
+				__('New site created by %1$s
147 147
 
148 148
 Address: %2$s
149 149
 Name: %3$s' ),
150 150
 				$current_user->user_login,
151
-				get_site_url( $id ),
152
-				wp_unslash( $title )
151
+				get_site_url($id),
152
+				wp_unslash($title)
153 153
 			),
154 154
 			sprintf(
155 155
 				'From: "%1$s" <%2$s>',
156
-				_x( 'Site Admin', 'email "From" field' ),
157
-				get_site_option( 'admin_email' )
156
+				_x('Site Admin', 'email "From" field'),
157
+				get_site_option('admin_email')
158 158
 			)
159 159
 		);
160
-		wpmu_welcome_notification( $id, $user_id, $password, $title, array( 'public' => 1 ) );
161
-		wp_redirect( add_query_arg( array( 'update' => 'added', 'id' => $id ), 'site-new.php' ) );
160
+		wpmu_welcome_notification($id, $user_id, $password, $title, array('public' => 1));
161
+		wp_redirect(add_query_arg(array('update' => 'added', 'id' => $id), 'site-new.php'));
162 162
 		exit;
163 163
 	} else {
164
-		wp_die( $id->get_error_message() );
164
+		wp_die($id->get_error_message());
165 165
 	}
166 166
 }
167 167
 
168
-if ( isset($_GET['update']) ) {
168
+if (isset($_GET['update'])) {
169 169
 	$messages = array();
170
-	if ( 'added' == $_GET['update'] )
170
+	if ('added' == $_GET['update'])
171 171
 		$messages[] = sprintf(
172 172
 			/* translators: 1: dashboard url, 2: network admin edit url */
173
-			__( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ),
174
-			esc_url( get_admin_url( absint( $_GET['id'] ) ) ),
175
-			network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )
173
+			__('Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>'),
174
+			esc_url(get_admin_url(absint($_GET['id']))),
175
+			network_admin_url('site-info.php?id='.absint($_GET['id']))
176 176
 		);
177 177
 }
178 178
 
179 179
 $title = __('Add New Site');
180 180
 $parent_file = 'sites.php';
181 181
 
182
-wp_enqueue_script( 'user-suggest' );
182
+wp_enqueue_script('user-suggest');
183 183
 
184
-require( ABSPATH . 'wp-admin/admin-header.php' );
184
+require(ABSPATH.'wp-admin/admin-header.php');
185 185
 
186 186
 ?>
187 187
 
188 188
 <div class="wrap">
189
-<h1 id="add-new-site"><?php _e( 'Add New Site' ); ?></h1>
189
+<h1 id="add-new-site"><?php _e('Add New Site'); ?></h1>
190 190
 <?php
191
-if ( ! empty( $messages ) ) {
192
-	foreach ( $messages as $msg )
193
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
191
+if ( ! empty($messages)) {
192
+	foreach ($messages as $msg)
193
+		echo '<div id="message" class="updated notice is-dismissible"><p>'.$msg.'</p></div>';
194 194
 } ?>
195
-<form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
196
-<?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
195
+<form method="post" action="<?php echo network_admin_url('site-new.php?action=add-site'); ?>" novalidate="novalidate">
196
+<?php wp_nonce_field('add-blog', '_wpnonce_add-blog') ?>
197 197
 	<table class="form-table">
198 198
 		<tr class="form-field form-required">
199
-			<th scope="row"><label for="site-address"><?php _e( 'Site Address (URL)' ) ?></label></th>
199
+			<th scope="row"><label for="site-address"><?php _e('Site Address (URL)') ?></label></th>
200 200
 			<td>
201
-			<?php if ( is_subdomain_install() ) { ?>
202
-				<input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off"/><span class="no-break">.<?php echo preg_replace( '|^www\.|', '', get_network()->domain ); ?></span>
201
+			<?php if (is_subdomain_install()) { ?>
202
+				<input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc" autocapitalize="none" autocorrect="off"/><span class="no-break">.<?php echo preg_replace('|^www\.|', '', get_network()->domain); ?></span>
203 203
 			<?php } else {
204
-				echo get_network()->domain . get_network()->path ?><input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc"  autocapitalize="none" autocorrect="off" />
204
+				echo get_network()->domain.get_network()->path ?><input name="blog[domain]" type="text" class="regular-text" id="site-address" aria-describedby="site-address-desc"  autocapitalize="none" autocorrect="off" />
205 205
 			<?php }
206
-			echo '<p class="description" id="site-address-desc">' . __( 'Only lowercase letters (a-z), numbers, and hyphens are allowed.' ) . '</p>';
206
+			echo '<p class="description" id="site-address-desc">'.__('Only lowercase letters (a-z), numbers, and hyphens are allowed.').'</p>';
207 207
 			?>
208 208
 			</td>
209 209
 		</tr>
210 210
 		<tr class="form-field form-required">
211
-			<th scope="row"><label for="site-title"><?php _e( 'Site Title' ) ?></label></th>
211
+			<th scope="row"><label for="site-title"><?php _e('Site Title') ?></label></th>
212 212
 			<td><input name="blog[title]" type="text" class="regular-text" id="site-title" /></td>
213 213
 		</tr>
214 214
 		<?php
215 215
 		$languages    = get_available_languages();
216 216
 		$translations = wp_get_available_translations();
217
-		if ( ! empty( $languages ) || ! empty( $translations ) ) :
217
+		if ( ! empty($languages) || ! empty($translations)) :
218 218
 			?>
219 219
 			<tr class="form-field form-required">
220
-				<th scope="row"><label for="site-language"><?php _e( 'Site Language' ); ?></label></th>
220
+				<th scope="row"><label for="site-language"><?php _e('Site Language'); ?></label></th>
221 221
 				<td>
222 222
 					<?php
223 223
 					// Network default.
224
-					$lang = get_site_option( 'WPLANG' );
224
+					$lang = get_site_option('WPLANG');
225 225
 
226 226
 					// Use English if the default isn't available.
227
-					if ( ! in_array( $lang, $languages ) ) {
227
+					if ( ! in_array($lang, $languages)) {
228 228
 						$lang = '';
229 229
 					}
230 230
 
231
-					wp_dropdown_languages( array(
231
+					wp_dropdown_languages(array(
232 232
 						'name'                        => 'WPLANG',
233 233
 						'id'                          => 'site-language',
234 234
 						'selected'                    => $lang,
235 235
 						'languages'                   => $languages,
236 236
 						'translations'                => $translations,
237 237
 						'show_available_translations' => wp_can_install_language_pack(),
238
-					) );
238
+					));
239 239
 					?>
240 240
 				</td>
241 241
 			</tr>
242 242
 		<?php endif; // Languages. ?>
243 243
 		<tr class="form-field form-required">
244
-			<th scope="row"><label for="admin-email"><?php _e( 'Admin Email' ) ?></label></th>
244
+			<th scope="row"><label for="admin-email"><?php _e('Admin Email') ?></label></th>
245 245
 			<td><input name="blog[email]" type="email" class="regular-text wp-suggest-user" id="admin-email" data-autocomplete-type="search" data-autocomplete-field="user_email" /></td>
246 246
 		</tr>
247 247
 		<tr class="form-field">
248
-			<td colspan="2"><?php _e( 'A new user will be created if the above email address is not in the database.' ) ?><br /><?php _e( 'The username and password will be mailed to this email address.' ) ?></td>
248
+			<td colspan="2"><?php _e('A new user will be created if the above email address is not in the database.') ?><br /><?php _e('The username and password will be mailed to this email address.') ?></td>
249 249
 		</tr>
250 250
 	</table>
251 251
 
@@ -255,11 +255,11 @@  discard block
 block discarded – undo
255 255
 	 *
256 256
 	 * @since 4.5.0
257 257
 	 */
258
-	do_action( 'network_site_new_form' );
258
+	do_action('network_site_new_form');
259 259
 
260
-	submit_button( __( 'Add Site' ), 'primary', 'add-site' );
260
+	submit_button(__('Add Site'), 'primary', 'add-site');
261 261
 	?>
262 262
 	</form>
263 263
 </div>
264 264
 <?php
265
-require( ABSPATH . 'wp-admin/admin-footer.php' );
265
+require(ABSPATH.'wp-admin/admin-footer.php');
Please login to merge, or discard this patch.
Braces   +17 added lines, -12 removed lines patch added patch discarded remove patch
@@ -34,13 +34,15 @@  discard block
 block discarded – undo
34 34
 if ( isset($_REQUEST['action']) && 'add-site' == $_REQUEST['action'] ) {
35 35
 	check_admin_referer( 'add-blog', '_wpnonce_add-blog' );
36 36
 
37
-	if ( ! is_array( $_POST['blog'] ) )
38
-		wp_die( __( 'Can&#8217;t create an empty site.' ) );
37
+	if ( ! is_array( $_POST['blog'] ) ) {
38
+			wp_die( __( 'Can&#8217;t create an empty site.' ) );
39
+	}
39 40
 
40 41
 	$blog = $_POST['blog'];
41 42
 	$domain = '';
42
-	if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) )
43
-		$domain = strtolower( $blog['domain'] );
43
+	if ( preg_match( '|^([a-zA-Z0-9-])+$|', $blog['domain'] ) ) {
44
+			$domain = strtolower( $blog['domain'] );
45
+	}
44 46
 
45 47
 	// If not a subdomain install, make sure the domain isn't a reserved word
46 48
 	if ( ! is_subdomain_install() ) {
@@ -74,8 +76,9 @@  discard block
 block discarded – undo
74 76
 		}
75 77
 	}
76 78
 
77
-	if ( empty( $domain ) )
78
-		wp_die( __( 'Missing or invalid site address.' ) );
79
+	if ( empty( $domain ) ) {
80
+			wp_die( __( 'Missing or invalid site address.' ) );
81
+	}
79 82
 
80 83
 	if ( isset( $blog['email'] ) && '' === trim( $blog['email'] ) ) {
81 84
 		wp_die( __( 'Missing email address.' ) );
@@ -167,14 +170,15 @@  discard block
 block discarded – undo
167 170
 
168 171
 if ( isset($_GET['update']) ) {
169 172
 	$messages = array();
170
-	if ( 'added' == $_GET['update'] )
171
-		$messages[] = sprintf(
173
+	if ( 'added' == $_GET['update'] ) {
174
+			$messages[] = sprintf(
172 175
 			/* translators: 1: dashboard url, 2: network admin edit url */
173 176
 			__( 'Site added. <a href="%1$s">Visit Dashboard</a> or <a href="%2$s">Edit Site</a>' ),
174 177
 			esc_url( get_admin_url( absint( $_GET['id'] ) ) ),
175 178
 			network_admin_url( 'site-info.php?id=' . absint( $_GET['id'] ) )
176 179
 		);
177
-}
180
+	}
181
+	}
178 182
 
179 183
 $title = __('Add New Site');
180 184
 $parent_file = 'sites.php';
@@ -189,9 +193,10 @@  discard block
 block discarded – undo
189 193
 <h1 id="add-new-site"><?php _e( 'Add New Site' ); ?></h1>
190 194
 <?php
191 195
 if ( ! empty( $messages ) ) {
192
-	foreach ( $messages as $msg )
193
-		echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
194
-} ?>
196
+	foreach ( $messages as $msg ) {
197
+			echo '<div id="message" class="updated notice is-dismissible"><p>' . $msg . '</p></div>';
198
+	}
199
+	} ?>
195 200
 <form method="post" action="<?php echo network_admin_url( 'site-new.php?action=add-site' ); ?>" novalidate="novalidate">
196 201
 <?php wp_nonce_field( 'add-blog', '_wpnonce_add-blog' ) ?>
197 202
 	<table class="form-table">
Please login to merge, or discard this patch.
src/wp-admin/network.php 2 patches
Braces   +5 added lines, -4 removed lines patch added patch discarded remove patch
@@ -97,10 +97,11 @@
 block discarded – undo
97 97
 	if ( ! network_domain_check() ) {
98 98
 		$result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), wp_unslash( $_POST['sitename'] ), $base, $subdomain_install );
99 99
 		if ( is_wp_error( $result ) ) {
100
-			if ( 1 == count( $result->get_error_codes() ) && 'no_wildcard_dns' == $result->get_error_code() )
101
-				network_step2( $result );
102
-			else
103
-				network_step1( $result );
100
+			if ( 1 == count( $result->get_error_codes() ) && 'no_wildcard_dns' == $result->get_error_code() ) {
101
+							network_step2( $result );
102
+			} else {
103
+							network_step1( $result );
104
+			}
104 105
 		} else {
105 106
 			network_step2();
106 107
 		}
Please login to merge, or discard this patch.
Spacing   +47 added lines, -47 removed lines patch added patch discarded remove patch
@@ -10,104 +10,104 @@  discard block
 block discarded – undo
10 10
  * @subpackage Administration
11 11
  */
12 12
 
13
-define( 'WP_INSTALLING_NETWORK', true );
13
+define('WP_INSTALLING_NETWORK', true);
14 14
 
15 15
 /** WordPress Administration Bootstrap */
16
-require_once( dirname( __FILE__ ) . '/admin.php' );
16
+require_once(dirname(__FILE__).'/admin.php');
17 17
 
18
-if ( ! current_user_can( 'setup_network' ) ) {
19
-	wp_die( __( 'Sorry, you are not allowed to manage options for this site.' ) );
18
+if ( ! current_user_can('setup_network')) {
19
+	wp_die(__('Sorry, you are not allowed to manage options for this site.'));
20 20
 }
21 21
 
22
-if ( is_multisite() ) {
23
-	if ( ! is_network_admin() ) {
24
-		wp_redirect( network_admin_url( 'setup.php' ) );
22
+if (is_multisite()) {
23
+	if ( ! is_network_admin()) {
24
+		wp_redirect(network_admin_url('setup.php'));
25 25
 		exit;
26 26
 	}
27 27
 
28
-	if ( ! defined( 'MULTISITE' ) ) {
29
-		wp_die( __( 'The Network creation panel is not for WordPress MU networks.' ) );
28
+	if ( ! defined('MULTISITE')) {
29
+		wp_die(__('The Network creation panel is not for WordPress MU networks.'));
30 30
 	}
31 31
 }
32 32
 
33
-require_once( dirname( __FILE__ ) . '/includes/network.php' );
33
+require_once(dirname(__FILE__).'/includes/network.php');
34 34
 
35 35
 // We need to create references to ms global tables to enable Network.
36
-foreach ( $wpdb->tables( 'ms_global' ) as $table => $prefixed_table ) {
36
+foreach ($wpdb->tables('ms_global') as $table => $prefixed_table) {
37 37
 	$wpdb->$table = $prefixed_table;
38 38
 }
39 39
 
40
-if ( ! network_domain_check() && ( ! defined( 'WP_ALLOW_MULTISITE' ) || ! WP_ALLOW_MULTISITE ) ) {
40
+if ( ! network_domain_check() && ( ! defined('WP_ALLOW_MULTISITE') || ! WP_ALLOW_MULTISITE)) {
41 41
 	wp_die(
42 42
 		printf(
43 43
 			/* translators: 1: WP_ALLOW_MULTISITE 2: wp-config.php */
44
-			__( 'You must define the %1$s constant as true in your %2$s file to allow creation of a Network.' ),
44
+			__('You must define the %1$s constant as true in your %2$s file to allow creation of a Network.'),
45 45
 			'<code>WP_ALLOW_MULTISITE</code>',
46 46
 			'<code>wp-config.php</code>'
47 47
 		)
48 48
 	);
49 49
 }
50 50
 
51
-if ( is_network_admin() ) {
52
-	$title = __( 'Network Setup' );
51
+if (is_network_admin()) {
52
+	$title = __('Network Setup');
53 53
 	$parent_file = 'settings.php';
54 54
 } else {
55
-	$title = __( 'Create a Network of WordPress Sites' );
55
+	$title = __('Create a Network of WordPress Sites');
56 56
 	$parent_file = 'tools.php';
57 57
 }
58 58
 
59
-$network_help = '<p>' . __('This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.') . '</p>' .
60
-	'<p>' . __('Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your install. Fill out the network details, and click install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).') . '</p>' .
61
-	'<p>' . __('The next screen for Network Setup will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.') . '</p>' .
62
-	'<p>' . __('Add the designated lines of code to wp-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing WordPress rules).') . '</p>' .
63
-	'<p>' . __('Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.') . '</p>' .
64
-	'<p>' . __('The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with &#8220;/blog/&#8221; from the main site. This disabling will be addressed in a future version.') . '</p>' .
65
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
66
-	'<p>' . __( '<a href="https://codex.wordpress.org/Create_A_Network">Documentation on Creating a Network</a>' ) . '</p>' .
67
-	'<p>' . __( '<a href="https://codex.wordpress.org/Tools_Network_Screen">Documentation on the Network Screen</a>' ) . '</p>';
68
-
69
-get_current_screen()->add_help_tab( array(
59
+$network_help = '<p>'.__('This screen allows you to configure a network as having subdomains (<code>site1.example.com</code>) or subdirectories (<code>example.com/site1</code>). Subdomains require wildcard subdomains to be enabled in Apache and DNS records, if your host allows it.').'</p>'.
60
+	'<p>'.__('Choose subdomains or subdirectories; this can only be switched afterwards by reconfiguring your install. Fill out the network details, and click install. If this does not work, you may have to add a wildcard DNS record (for subdomains) or change to another setting in Permalinks (for subdirectories).').'</p>'.
61
+	'<p>'.__('The next screen for Network Setup will give you individually-generated lines of code to add to your wp-config.php and .htaccess files. Make sure the settings of your FTP client make files starting with a dot visible, so that you can find .htaccess; you may have to create this file if it really is not there. Make backup copies of those two files.').'</p>'.
62
+	'<p>'.__('Add the designated lines of code to wp-config.php (just before <code>/*...stop editing...*/</code>) and <code>.htaccess</code> (replacing the existing WordPress rules).').'</p>'.
63
+	'<p>'.__('Once you add this code and refresh your browser, multisite should be enabled. This screen, now in the Network Admin navigation menu, will keep an archive of the added code. You can toggle between Network Admin and Site Admin by clicking on the Network Admin or an individual site name under the My Sites dropdown in the Toolbar.').'</p>'.
64
+	'<p>'.__('The choice of subdirectory sites is disabled if this setup is more than a month old because of permalink problems with &#8220;/blog/&#8221; from the main site. This disabling will be addressed in a future version.').'</p>'.
65
+	'<p><strong>'.__('For more information:').'</strong></p>'.
66
+	'<p>'.__('<a href="https://codex.wordpress.org/Create_A_Network">Documentation on Creating a Network</a>').'</p>'.
67
+	'<p>'.__('<a href="https://codex.wordpress.org/Tools_Network_Screen">Documentation on the Network Screen</a>').'</p>';
68
+
69
+get_current_screen()->add_help_tab(array(
70 70
 	'id'      => 'network',
71 71
 	'title'   => __('Network'),
72 72
 	'content' => $network_help,
73
-) );
73
+));
74 74
 
75 75
 get_current_screen()->set_help_sidebar(
76
-	'<p><strong>' . __('For more information:') . '</strong></p>' .
77
-	'<p>' . __( '<a href="https://codex.wordpress.org/Create_A_Network">Documentation on Creating a Network</a>' ) . '</p>' .
78
-	'<p>' . __( '<a href="https://codex.wordpress.org/Tools_Network_Screen">Documentation on the Network Screen</a>' ) . '</p>' .
79
-	'<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
76
+	'<p><strong>'.__('For more information:').'</strong></p>'.
77
+	'<p>'.__('<a href="https://codex.wordpress.org/Create_A_Network">Documentation on Creating a Network</a>').'</p>'.
78
+	'<p>'.__('<a href="https://codex.wordpress.org/Tools_Network_Screen">Documentation on the Network Screen</a>').'</p>'.
79
+	'<p>'.__('<a href="https://wordpress.org/support/">Support Forums</a>').'</p>'
80 80
 );
81 81
 
82
-include( ABSPATH . 'wp-admin/admin-header.php' );
82
+include(ABSPATH.'wp-admin/admin-header.php');
83 83
 ?>
84 84
 <div class="wrap">
85
-<h1><?php echo esc_html( $title ); ?></h1>
85
+<h1><?php echo esc_html($title); ?></h1>
86 86
 
87 87
 <?php
88
-if ( $_POST ) {
88
+if ($_POST) {
89 89
 
90
-	check_admin_referer( 'install-network-1' );
90
+	check_admin_referer('install-network-1');
91 91
 
92
-	require_once( ABSPATH . 'wp-admin/includes/upgrade.php' );
92
+	require_once(ABSPATH.'wp-admin/includes/upgrade.php');
93 93
 	// Create network tables.
94 94
 	install_network();
95
-	$base              = parse_url( trailingslashit( get_option( 'home' ) ), PHP_URL_PATH );
96
-	$subdomain_install = allow_subdomain_install() ? !empty( $_POST['subdomain_install'] ) : false;
97
-	if ( ! network_domain_check() ) {
98
-		$result = populate_network( 1, get_clean_basedomain(), sanitize_email( $_POST['email'] ), wp_unslash( $_POST['sitename'] ), $base, $subdomain_install );
99
-		if ( is_wp_error( $result ) ) {
100
-			if ( 1 == count( $result->get_error_codes() ) && 'no_wildcard_dns' == $result->get_error_code() )
101
-				network_step2( $result );
95
+	$base              = parse_url(trailingslashit(get_option('home')), PHP_URL_PATH);
96
+	$subdomain_install = allow_subdomain_install() ? ! empty($_POST['subdomain_install']) : false;
97
+	if ( ! network_domain_check()) {
98
+		$result = populate_network(1, get_clean_basedomain(), sanitize_email($_POST['email']), wp_unslash($_POST['sitename']), $base, $subdomain_install);
99
+		if (is_wp_error($result)) {
100
+			if (1 == count($result->get_error_codes()) && 'no_wildcard_dns' == $result->get_error_code())
101
+				network_step2($result);
102 102
 			else
103
-				network_step1( $result );
103
+				network_step1($result);
104 104
 		} else {
105 105
 			network_step2();
106 106
 		}
107 107
 	} else {
108 108
 		network_step2();
109 109
 	}
110
-} elseif ( is_multisite() || network_domain_check() ) {
110
+} elseif (is_multisite() || network_domain_check()) {
111 111
 	network_step2();
112 112
 } else {
113 113
 	network_step1();
@@ -115,4 +115,4 @@  discard block
 block discarded – undo
115 115
 ?>
116 116
 </div>
117 117
 
118
-<?php include( ABSPATH . 'wp-admin/admin-footer.php' ); ?>
118
+<?php include(ABSPATH.'wp-admin/admin-footer.php'); ?>
Please login to merge, or discard this patch.