@@ -38,7 +38,9 @@ discard block |
||
38 | 38 | $po = new PO; |
39 | 39 | foreach($this->headers as $header) { |
40 | 40 | $string = $makepot->get_addon_header($header, $source); |
41 | - if (!$string) continue; |
|
41 | + if (!$string) { |
|
42 | + continue; |
|
43 | + } |
|
42 | 44 | $args = array( |
43 | 45 | 'singular' => $string, |
44 | 46 | 'extracted_comments' => $header.' of the plugin/theme', |
@@ -50,17 +52,22 @@ discard block |
||
50 | 52 | } |
51 | 53 | |
52 | 54 | function append( $ext_filename, $pot_filename, $headers = null ) { |
53 | - if ( $headers ) |
|
54 | - $this->headers = (array) $headers; |
|
55 | + if ( $headers ) { |
|
56 | + $this->headers = (array) $headers; |
|
57 | + } |
|
55 | 58 | if ( is_dir( $ext_filename ) ) { |
56 | 59 | $pot = implode('', array_map(array($this, 'load_from_file'), glob("$ext_filename/*.php"))); |
57 | 60 | } else { |
58 | 61 | $pot = $this->load_from_file($ext_filename); |
59 | 62 | } |
60 | 63 | $potf = '-' == $pot_filename? STDOUT : fopen($pot_filename, 'a'); |
61 | - if (!$potf) return false; |
|
64 | + if (!$potf) { |
|
65 | + return false; |
|
66 | + } |
|
62 | 67 | fwrite($potf, $pot); |
63 | - if ('-' != $pot_filename) fclose($potf); |
|
68 | + if ('-' != $pot_filename) { |
|
69 | + fclose($potf); |
|
70 | + } |
|
64 | 71 | return true; |
65 | 72 | } |
66 | 73 | } |
@@ -7,10 +7,11 @@ discard block |
||
7 | 7 | * @subpackage tools |
8 | 8 | */ |
9 | 9 | // see: http://php.net/tokenizer |
10 | -if ( ! defined( 'T_ML_COMMENT' ) ) |
|
10 | +if ( ! defined( 'T_ML_COMMENT' ) ) { |
|
11 | 11 | define( 'T_ML_COMMENT', T_COMMENT ); |
12 | -else |
|
12 | +} else { |
|
13 | 13 | define( 'T_DOC_COMMENT', T_ML_COMMENT ); |
14 | +} |
|
14 | 15 | |
15 | 16 | $pomo = dirname( dirname( dirname( __FILE__ ) ) ) . '/src/wp-includes/pomo'; |
16 | 17 | require_once "$pomo/po.php"; |
@@ -31,7 +32,9 @@ discard block |
||
31 | 32 | |
32 | 33 | function logmsg() { |
33 | 34 | $args = func_get_args(); |
34 | - if ($this->enable_logging) error_log(implode(' ', $args)); |
|
35 | + if ($this->enable_logging) { |
|
36 | + error_log(implode(' ', $args)); |
|
37 | + } |
|
35 | 38 | } |
36 | 39 | |
37 | 40 | function stderr($msg, $nl=true) { |
@@ -56,12 +59,15 @@ discard block |
||
56 | 59 | $items = scandir( $dir ); |
57 | 60 | foreach ( (array) $items as $item ) { |
58 | 61 | $full_item = $dir . '/' . $item; |
59 | - if ('.' == $item || '..' == $item) |
|
60 | - continue; |
|
61 | - if ('.php' == substr($item, -4)) |
|
62 | - $files[] = $full_item; |
|
63 | - if (is_dir($full_item)) |
|
64 | - $files += array_merge($files, NotGettexted::list_php_files($full_item, $files)); |
|
62 | + if ('.' == $item || '..' == $item) { |
|
63 | + continue; |
|
64 | + } |
|
65 | + if ('.php' == substr($item, -4)) { |
|
66 | + $files[] = $full_item; |
|
67 | + } |
|
68 | + if (is_dir($full_item)) { |
|
69 | + $files += array_merge($files, NotGettexted::list_php_files($full_item, $files)); |
|
70 | + } |
|
65 | 71 | } |
66 | 72 | return $files; |
67 | 73 | } |
@@ -102,7 +108,9 @@ discard block |
||
102 | 108 | $stage = $this->STAGE_END_COMMENT; |
103 | 109 | $this->logmsg('end comment', $current_comment_id); |
104 | 110 | $result .= call_user_func($other_action, $token); |
105 | - if (!is_null($register_action)) call_user_func($register_action, $current_string, $current_comment_id, $current_string_line); |
|
111 | + if (!is_null($register_action)) { |
|
112 | + call_user_func($register_action, $current_string, $current_comment_id, $current_string_line); |
|
113 | + } |
|
106 | 114 | continue; |
107 | 115 | } |
108 | 116 | } else if (T_CONSTANT_ENCAPSED_STRING == $id) { |
@@ -141,10 +149,11 @@ discard block |
||
141 | 149 | function command_extract() { |
142 | 150 | $args = func_get_args(); |
143 | 151 | $pot_filename = $args[0]; |
144 | - if (isset($args[1]) && is_array($args[1])) |
|
145 | - $filenames = $args[1]; |
|
146 | - else |
|
147 | - $filenames = array_slice($args, 1); |
|
152 | + if (isset($args[1]) && is_array($args[1])) { |
|
153 | + $filenames = $args[1]; |
|
154 | + } else { |
|
155 | + $filenames = array_slice($args, 1); |
|
156 | + } |
|
148 | 157 | |
149 | 158 | $global_name = '__entries_'.mt_rand(1, 1000); |
150 | 159 | $GLOBALS[$global_name] = array(); |
@@ -172,17 +181,20 @@ discard block |
||
172 | 181 | $entry = new Translation_Entry($args); |
173 | 182 | fwrite($potf, "\n".PO::export_entry($entry)."\n"); |
174 | 183 | } |
175 | - if ('-' != $pot_filename) fclose($potf); |
|
184 | + if ('-' != $pot_filename) { |
|
185 | + fclose($potf); |
|
186 | + } |
|
176 | 187 | return true; |
177 | 188 | } |
178 | 189 | |
179 | 190 | function command_replace() { |
180 | 191 | $args = func_get_args(); |
181 | 192 | $mo_filename = $args[0]; |
182 | - if (isset($args[1]) && is_array($args[1])) |
|
183 | - $filenames = $args[1]; |
|
184 | - else |
|
185 | - $filenames = array_slice($args, 1); |
|
193 | + if (isset($args[1]) && is_array($args[1])) { |
|
194 | + $filenames = $args[1]; |
|
195 | + } else { |
|
196 | + $filenames = array_slice($args, 1); |
|
197 | + } |
|
186 | 198 | |
187 | 199 | $global_name = '__mo_'.mt_rand(1, 1000); |
188 | 200 | $GLOBALS[$global_name] = new MO(); |
@@ -194,7 +206,9 @@ discard block |
||
194 | 206 | } |
195 | 207 | foreach($filenames as $filename) { |
196 | 208 | $source = file_get_contents($filename); |
197 | - if ( strlen($source) > 150000 ) continue; |
|
209 | + if ( strlen($source) > 150000 ) { |
|
210 | + continue; |
|
211 | + } |
|
198 | 212 | $tokens = token_get_all($source); |
199 | 213 | $new_file = $this->walk_tokens($tokens, $replacer, array($this, 'unchanged_token')); |
200 | 214 | $f = fopen($filename, 'w'); |
@@ -2,8 +2,11 @@ |
||
2 | 2 | |
3 | 3 | if (! isset($wp_did_header)): |
4 | 4 | if ( !file_exists( dirname(__FILE__) . '/wp-config.php') ) { |
5 | - if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) $path = ''; |
|
6 | - else $path = 'wp-admin/'; |
|
5 | + if (strpos($_SERVER['PHP_SELF'], 'wp-admin') !== false) { |
|
6 | + $path = ''; |
|
7 | + } else { |
|
8 | + $path = 'wp-admin/'; |
|
9 | + } |
|
7 | 10 | |
8 | 11 | require_once( dirname(__FILE__) . '/wp-includes/classes.php'); |
9 | 12 | require_once( dirname(__FILE__) . '/wp-includes/functions.php'); |
@@ -26,7 +26,9 @@ discard block |
||
26 | 26 | $translations = new Translations; |
27 | 27 | $file_names = (array) scandir( '.' ); |
28 | 28 | foreach ( $file_names as $file_name ) { |
29 | - if ( '.' == $file_name || '..' == $file_name ) continue; |
|
29 | + if ( '.' == $file_name || '..' == $file_name ) { |
|
30 | + continue; |
|
31 | + } |
|
30 | 32 | if ( preg_match( '/\.php$/', $file_name ) && $this->does_file_name_match( $prefix . $file_name, $excludes, $includes ) ) { |
31 | 33 | $extracted = $this->extract_from_file( $file_name, $prefix ); |
32 | 34 | $translations->merge_originals_with( $extracted ); |
@@ -54,7 +56,9 @@ discard block |
||
54 | 56 | break; |
55 | 57 | } |
56 | 58 | } |
57 | - if ( !$matched_any_include ) return false; |
|
59 | + if ( !$matched_any_include ) { |
|
60 | + return false; |
|
61 | + } |
|
58 | 62 | } |
59 | 63 | if ( $excludes ) { |
60 | 64 | foreach( $excludes as $exclude ) { |
@@ -68,12 +72,16 @@ discard block |
||
68 | 72 | |
69 | 73 | function entry_from_call( $call, $file_name ) { |
70 | 74 | $rule = isset( $this->rules[$call['name']] )? $this->rules[$call['name']] : null; |
71 | - if ( !$rule ) return null; |
|
75 | + if ( !$rule ) { |
|
76 | + return null; |
|
77 | + } |
|
72 | 78 | $entry = new Translation_Entry; |
73 | 79 | $multiple = array(); |
74 | 80 | $complete = false; |
75 | 81 | for( $i = 0; $i < count( $rule ); ++$i ) { |
76 | - if ( $rule[$i] && ( !isset( $call['args'][$i] ) || !is_string( $call['args'][$i] ) || '' == $call['args'][$i] ) ) return false; |
|
82 | + if ( $rule[$i] && ( !isset( $call['args'][$i] ) || !is_string( $call['args'][$i] ) || '' == $call['args'][$i] ) ) { |
|
83 | + return false; |
|
84 | + } |
|
77 | 85 | switch( $rule[$i] ) { |
78 | 86 | case 'string': |
79 | 87 | if ( $complete ) { |
@@ -133,11 +141,12 @@ discard block |
||
133 | 141 | $function_calls = $this->find_function_calls( array_keys( $this->rules ), $code ); |
134 | 142 | foreach( $function_calls as $call ) { |
135 | 143 | $entry = $this->entry_from_call( $call, $file_name ); |
136 | - if ( is_array( $entry ) ) |
|
137 | - foreach( $entry as $single_entry ) |
|
144 | + if ( is_array( $entry ) ) { |
|
145 | + foreach( $entry as $single_entry ) |
|
138 | 146 | $translations->add_entry_or_merge( $single_entry ); |
139 | - elseif ( $entry) |
|
140 | - $translations->add_entry_or_merge( $entry ); |
|
147 | + } elseif ( $entry) { |
|
148 | + $translations->add_entry_or_merge( $entry ); |
|
149 | + } |
|
141 | 150 | } |
142 | 151 | return $translations; |
143 | 152 | } |
@@ -155,8 +164,12 @@ discard block |
||
155 | 164 | $in_func = false; |
156 | 165 | foreach( $tokens as $token ) { |
157 | 166 | $id = $text = null; |
158 | - if ( is_array( $token ) ) list( $id, $text, $line ) = $token; |
|
159 | - if ( T_WHITESPACE == $id ) continue; |
|
167 | + if ( is_array( $token ) ) { |
|
168 | + list( $id, $text, $line ) = $token; |
|
169 | + } |
|
170 | + if ( T_WHITESPACE == $id ) { |
|
171 | + continue; |
|
172 | + } |
|
160 | 173 | if ( T_STRING == $id && in_array( $text, $function_names ) && !$in_func ) { |
161 | 174 | $in_func = true; |
162 | 175 | $paren_level = -1; |
@@ -177,7 +190,9 @@ discard block |
||
177 | 190 | $latest_comment = $text; |
178 | 191 | } |
179 | 192 | } |
180 | - if ( !$in_func ) continue; |
|
193 | + if ( !$in_func ) { |
|
194 | + continue; |
|
195 | + } |
|
181 | 196 | if ( '(' == $token ) { |
182 | 197 | $paren_level++; |
183 | 198 | if ( 0 == $paren_level ) { // start of first argument |
@@ -197,7 +212,9 @@ discard block |
||
197 | 212 | $in_func = false; |
198 | 213 | $args[] = $current_argument; |
199 | 214 | $call = array( 'name' => $func_name, 'args' => $args, 'line' => $func_line ); |
200 | - if ( $func_comment ) $call['comment'] = $func_comment; |
|
215 | + if ( $func_comment ) { |
|
216 | + $call['comment'] = $func_comment; |
|
217 | + } |
|
201 | 218 | $function_calls[] = $call; |
202 | 219 | } |
203 | 220 | $paren_level--; |
@@ -22,8 +22,9 @@ discard block |
||
22 | 22 | } |
23 | 23 | |
24 | 24 | // fix for mozBlog and other cases where '<?xml' isn't on the very first line |
25 | -if ( isset($HTTP_RAW_POST_DATA) ) |
|
25 | +if ( isset($HTTP_RAW_POST_DATA) ) { |
|
26 | 26 | $HTTP_RAW_POST_DATA = trim($HTTP_RAW_POST_DATA); |
27 | +} |
|
27 | 28 | |
28 | 29 | /** Include the bootstrap for setting up WordPress environment */ |
29 | 30 | include( dirname( __FILE__ ) . '/wp-load.php' ); |
@@ -96,6 +97,7 @@ discard block |
||
96 | 97 | */ |
97 | 98 | function logIO( $io, $msg ) { |
98 | 99 | _deprecated_function( __FUNCTION__, '3.4', 'error_log()' ); |
99 | - if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) |
|
100 | - error_log( $io . ' - ' . $msg ); |
|
101 | -} |
|
102 | 100 | \ No newline at end of file |
101 | + if ( ! empty( $GLOBALS['xmlrpc_logging'] ) ) { |
|
102 | + error_log( $io . ' - ' . $msg ); |
|
103 | + } |
|
104 | + } |
|
103 | 105 | \ No newline at end of file |
@@ -11,8 +11,9 @@ discard block |
||
11 | 11 | |
12 | 12 | ignore_user_abort(true); |
13 | 13 | |
14 | -if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') ) |
|
14 | +if ( !empty($_POST) || defined('DOING_AJAX') || defined('DOING_CRON') ) { |
|
15 | 15 | die(); |
16 | +} |
|
16 | 17 | |
17 | 18 | /** |
18 | 19 | * Tell WordPress we are doing the CRON task. |
@@ -48,21 +49,24 @@ discard block |
||
48 | 49 | $value = wp_cache_get( 'doing_cron', 'transient', true ); |
49 | 50 | } else { |
50 | 51 | $row = $wpdb->get_row( $wpdb->prepare( "SELECT option_value FROM $wpdb->options WHERE option_name = %s LIMIT 1", '_transient_doing_cron' ) ); |
51 | - if ( is_object( $row ) ) |
|
52 | - $value = $row->option_value; |
|
52 | + if ( is_object( $row ) ) { |
|
53 | + $value = $row->option_value; |
|
54 | + } |
|
53 | 55 | } |
54 | 56 | |
55 | 57 | return $value; |
56 | 58 | } |
57 | 59 | |
58 | -if ( false === $crons = _get_cron_array() ) |
|
60 | +if ( false === $crons = _get_cron_array() ) { |
|
59 | 61 | die(); |
62 | +} |
|
60 | 63 | |
61 | 64 | $keys = array_keys( $crons ); |
62 | 65 | $gmt_time = microtime( true ); |
63 | 66 | |
64 | -if ( isset($keys[0]) && $keys[0] > $gmt_time ) |
|
67 | +if ( isset($keys[0]) && $keys[0] > $gmt_time ) { |
|
65 | 68 | die(); |
69 | +} |
|
66 | 70 | |
67 | 71 | |
68 | 72 | // The cron lock: a unix timestamp from when the cron was spawned. |
@@ -72,8 +76,9 @@ discard block |
||
72 | 76 | if ( empty( $doing_wp_cron ) ) { |
73 | 77 | if ( empty( $_GET[ 'doing_wp_cron' ] ) ) { |
74 | 78 | // Called from external script/job. Try setting a lock. |
75 | - if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) |
|
76 | - return; |
|
79 | + if ( $doing_cron_transient && ( $doing_cron_transient + WP_CRON_LOCK_TIMEOUT > $gmt_time ) ) { |
|
80 | + return; |
|
81 | + } |
|
77 | 82 | $doing_cron_transient = $doing_wp_cron = sprintf( '%.22F', microtime( true ) ); |
78 | 83 | set_transient( 'doing_cron', $doing_wp_cron ); |
79 | 84 | } else { |
@@ -85,12 +90,14 @@ discard block |
||
85 | 90 | * The cron lock (a unix timestamp set when the cron was spawned), |
86 | 91 | * must match $doing_wp_cron (the "key"). |
87 | 92 | */ |
88 | -if ( $doing_cron_transient != $doing_wp_cron ) |
|
93 | +if ( $doing_cron_transient != $doing_wp_cron ) { |
|
89 | 94 | return; |
95 | +} |
|
90 | 96 | |
91 | 97 | foreach ( $crons as $timestamp => $cronhooks ) { |
92 | - if ( $timestamp > $gmt_time ) |
|
93 | - break; |
|
98 | + if ( $timestamp > $gmt_time ) { |
|
99 | + break; |
|
100 | + } |
|
94 | 101 | |
95 | 102 | foreach ( $cronhooks as $hook => $keys ) { |
96 | 103 | |
@@ -117,13 +124,15 @@ discard block |
||
117 | 124 | do_action_ref_array( $hook, $v['args'] ); |
118 | 125 | |
119 | 126 | // If the hook ran too long and another cron process stole the lock, quit. |
120 | - if ( _get_cron_lock() != $doing_wp_cron ) |
|
121 | - return; |
|
127 | + if ( _get_cron_lock() != $doing_wp_cron ) { |
|
128 | + return; |
|
129 | + } |
|
122 | 130 | } |
123 | 131 | } |
124 | 132 | } |
125 | 133 | |
126 | -if ( _get_cron_lock() == $doing_wp_cron ) |
|
134 | +if ( _get_cron_lock() == $doing_wp_cron ) { |
|
127 | 135 | delete_transient( 'doing_cron' ); |
136 | +} |
|
128 | 137 | |
129 | 138 | die(); |
@@ -18,8 +18,9 @@ discard block |
||
18 | 18 | die(); |
19 | 19 | } |
20 | 20 | |
21 | -if ( is_object( $wp_object_cache ) ) |
|
21 | +if ( is_object( $wp_object_cache ) ) { |
|
22 | 22 | $wp_object_cache->cache_enabled = false; |
23 | +} |
|
23 | 24 | |
24 | 25 | // Fix for page title |
25 | 26 | $wp_query->is_404 = false; |
@@ -117,8 +118,11 @@ discard block |
||
117 | 118 | |
118 | 119 | <?php if ( $url && $url != network_home_url( '', 'http' ) ) : ?> |
119 | 120 | <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">View your site</a> or <a href="%2$s">Log in</a>'), $url, $url . 'wp-login.php' ); ?></p> |
120 | - <?php else: ?> |
|
121 | - <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url('wp-login.php', 'login'), network_home_url() ); ?></p> |
|
121 | + <?php else { |
|
122 | + : ?> |
|
123 | + <p class="view"><?php printf( __('Your account is now activated. <a href="%1$s">Log in</a> or go back to the <a href="%2$s">homepage</a>.' ), network_site_url('wp-login.php', 'login'), network_home_url() ); |
|
124 | +} |
|
125 | +?></p> |
|
122 | 126 | <?php endif; |
123 | 127 | } |
124 | 128 | } |
@@ -57,14 +57,16 @@ discard block |
||
57 | 57 | $excerpt = isset($_POST['excerpt']) ? wp_unslash($_POST['excerpt']) : ''; |
58 | 58 | $blog_name = isset($_POST['blog_name']) ? wp_unslash($_POST['blog_name']) : ''; |
59 | 59 | |
60 | -if ($charset) |
|
60 | +if ($charset) { |
|
61 | 61 | $charset = str_replace( array(',', ' '), '', strtoupper( trim($charset) ) ); |
62 | -else |
|
62 | +} else { |
|
63 | 63 | $charset = 'ASCII, UTF-8, ISO-8859-1, JIS, EUC-JP, SJIS'; |
64 | +} |
|
64 | 65 | |
65 | 66 | // No valid uses for UTF-7. |
66 | -if ( false !== strpos($charset, 'UTF-7') ) |
|
67 | +if ( false !== strpos($charset, 'UTF-7') ) { |
|
67 | 68 | die; |
69 | +} |
|
68 | 70 | |
69 | 71 | // For international trackbacks. |
70 | 72 | if ( function_exists('mb_convert_encoding') ) { |
@@ -78,11 +80,13 @@ discard block |
||
78 | 80 | $excerpt = wp_slash($excerpt); |
79 | 81 | $blog_name = wp_slash($blog_name); |
80 | 82 | |
81 | -if ( is_single() || is_page() ) |
|
83 | +if ( is_single() || is_page() ) { |
|
82 | 84 | $tb_id = $posts[0]->ID; |
85 | +} |
|
83 | 86 | |
84 | -if ( !isset($tb_id) || !intval( $tb_id ) ) |
|
87 | +if ( !isset($tb_id) || !intval( $tb_id ) ) { |
|
85 | 88 | trackback_response(1, 'I really need an ID for this to work.'); |
89 | +} |
|
86 | 90 | |
87 | 91 | if (empty($title) && empty($tb_url) && empty($blog_name)) { |
88 | 92 | // If it doesn't look like a trackback at all. |
@@ -93,8 +97,9 @@ discard block |
||
93 | 97 | if ( !empty($tb_url) && !empty($title) ) { |
94 | 98 | header('Content-Type: text/xml; charset=' . get_option('blog_charset') ); |
95 | 99 | |
96 | - if ( !pings_open($tb_id) ) |
|
97 | - trackback_response(1, 'Sorry, trackbacks are closed for this item.'); |
|
100 | + if ( !pings_open($tb_id) ) { |
|
101 | + trackback_response(1, 'Sorry, trackbacks are closed for this item.'); |
|
102 | + } |
|
98 | 103 | |
99 | 104 | $title = wp_html_excerpt( $title, 250, '…' ); |
100 | 105 | $excerpt = wp_html_excerpt( $excerpt, 252, '…' ); |
@@ -107,8 +112,9 @@ discard block |
||
107 | 112 | $comment_type = 'trackback'; |
108 | 113 | |
109 | 114 | $dupe = $wpdb->get_results( $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_post_ID = %d AND comment_author_url = %s", $comment_post_ID, $comment_author_url) ); |
110 | - if ( $dupe ) |
|
111 | - trackback_response(1, 'We already have a ping from that URL for this post.'); |
|
115 | + if ( $dupe ) { |
|
116 | + trackback_response(1, 'We already have a ping from that URL for this post.'); |
|
117 | + } |
|
112 | 118 | |
113 | 119 | $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type'); |
114 | 120 |
@@ -61,8 +61,9 @@ discard block |
||
61 | 61 | wp_debug_mode(); |
62 | 62 | |
63 | 63 | // For an advanced caching plugin to use. Uses a static drop-in because you would only want one. |
64 | -if ( WP_CACHE ) |
|
64 | +if ( WP_CACHE ) { |
|
65 | 65 | WP_DEBUG ? include( WP_CONTENT_DIR . '/advanced-cache.php' ) : @include( WP_CONTENT_DIR . '/advanced-cache.php' ); |
66 | +} |
|
66 | 67 | |
67 | 68 | // Define WP_LANG_DIR if not set. |
68 | 69 | wp_set_lang_dir(); |
@@ -99,8 +100,9 @@ discard block |
||
99 | 100 | register_shutdown_function( 'shutdown_action_hook' ); |
100 | 101 | |
101 | 102 | // Stop most of WordPress from being loaded if we just want the basics. |
102 | -if ( SHORTINIT ) |
|
103 | +if ( SHORTINIT ) { |
|
103 | 104 | return false; |
105 | +} |
|
104 | 106 | |
105 | 107 | // Load the L10n library. |
106 | 108 | require_once( ABSPATH . WPINC . '/l10n.php' ); |
@@ -189,8 +191,9 @@ discard block |
||
189 | 191 | */ |
190 | 192 | do_action( 'muplugins_loaded' ); |
191 | 193 | |
192 | -if ( is_multisite() ) |
|
194 | +if ( is_multisite() ) { |
|
193 | 195 | ms_cookie_constants( ); |
196 | +} |
|
194 | 197 | |
195 | 198 | // Define constants after multisite is loaded. |
196 | 199 | wp_cookie_constants(); |
@@ -224,8 +227,9 @@ discard block |
||
224 | 227 | wp_set_internal_encoding(); |
225 | 228 | |
226 | 229 | // Run wp_cache_postload() if object cache is enabled and the function exists. |
227 | -if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) |
|
230 | +if ( WP_CACHE && function_exists( 'wp_cache_postload' ) ) { |
|
228 | 231 | wp_cache_postload(); |
232 | +} |
|
229 | 233 | |
230 | 234 | /** |
231 | 235 | * Fires once activated plugins have loaded. |
@@ -307,8 +311,9 @@ discard block |
||
307 | 311 | |
308 | 312 | $locale = get_locale(); |
309 | 313 | $locale_file = WP_LANG_DIR . "/$locale.php"; |
310 | -if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) |
|
314 | +if ( ( 0 === validate_file( $locale ) ) && is_readable( $locale_file ) ) { |
|
311 | 315 | require( $locale_file ); |
316 | +} |
|
312 | 317 | unset( $locale_file ); |
313 | 318 | |
314 | 319 | // Pull in locale data after loading text domain. |
@@ -323,11 +328,13 @@ discard block |
||
323 | 328 | |
324 | 329 | // Load the functions for the active theme, for both parent and child theme if applicable. |
325 | 330 | if ( ! defined( 'WP_INSTALLING' ) || 'wp-activate.php' === $pagenow ) { |
326 | - if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) |
|
327 | - include( STYLESHEETPATH . '/functions.php' ); |
|
328 | - if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) |
|
329 | - include( TEMPLATEPATH . '/functions.php' ); |
|
330 | -} |
|
331 | + if ( TEMPLATEPATH !== STYLESHEETPATH && file_exists( STYLESHEETPATH . '/functions.php' ) ) { |
|
332 | + include( STYLESHEETPATH . '/functions.php' ); |
|
333 | + } |
|
334 | + if ( file_exists( TEMPLATEPATH . '/functions.php' ) ) { |
|
335 | + include( TEMPLATEPATH . '/functions.php' ); |
|
336 | + } |
|
337 | + } |
|
331 | 338 | |
332 | 339 | /** |
333 | 340 | * Fires after the theme is loaded. |