From ef87172270525aef03fc7b9a210abbb90613b42c Mon Sep 17 00:00:00 2001 From: Scott Taylor Date: Tue, 25 Aug 2015 20:28:22 +0000 Subject: [PATCH] `foreach` is a statement, not a function. See #33491. Built from https://develop.svn.wordpress.org/trunk@33734 git-svn-id: http://core.svn.wordpress.org/trunk@33702 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit.php | 6 +++--- wp-admin/includes/class-wp-list-table.php | 2 +- wp-admin/includes/class-wp-press-this.php | 4 ++-- wp-admin/includes/dashboard.php | 2 +- wp-admin/includes/media.php | 4 ++-- wp-admin/includes/ms.php | 4 ++-- wp-admin/includes/nav-menu.php | 10 +++++----- wp-admin/includes/plugin-install.php | 2 +- wp-admin/includes/plugin.php | 4 ++-- wp-admin/includes/post.php | 4 ++-- wp-admin/includes/template.php | 2 +- wp-admin/includes/update-core.php | 2 +- wp-admin/includes/update.php | 4 ++-- wp-admin/includes/upgrade.php | 20 ++++++++++---------- wp-admin/load-scripts.php | 2 +- wp-admin/load-styles.php | 2 +- wp-admin/nav-menus.php | 10 +++++----- wp-admin/network/site-themes.php | 4 ++-- wp-admin/network/themes.php | 4 ++-- wp-admin/network/users.php | 2 +- wp-admin/plugins.php | 2 +- wp-admin/setup-config.php | 4 ++-- wp-admin/update-core.php | 4 ++-- wp-includes/class-oembed.php | 2 +- wp-includes/class-wp-customize-control.php | 2 +- wp-includes/class-wp-embed.php | 2 +- wp-includes/class-wp-image-editor.php | 2 +- wp-includes/class-wp-walker.php | 6 +++--- wp-includes/class-wp-xmlrpc-server.php | 8 ++++---- wp-includes/class-wp.php | 2 +- wp-includes/class.wp-dependencies.php | 2 +- wp-includes/comment.php | 2 +- wp-includes/formatting.php | 4 ++-- wp-includes/functions.php | 4 ++-- wp-includes/l10n.php | 2 +- wp-includes/nav-menu.php | 8 ++++---- wp-includes/pluggable.php | 2 +- wp-includes/plugin.php | 8 ++++---- wp-includes/post-formats.php | 2 +- wp-includes/post.php | 14 +++++++------- wp-includes/query.php | 2 +- wp-includes/revision.php | 2 +- wp-includes/rss.php | 2 +- wp-includes/shortcodes.php | 2 +- wp-includes/version.php | 2 +- wp-includes/wp-db.php | 8 ++++---- wp-settings.php | 2 +- 47 files changed, 98 insertions(+), 98 deletions(-) diff --git a/wp-admin/edit.php b/wp-admin/edit.php index 6c285d78ec..c9ef3b57cd 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -92,7 +92,7 @@ if ( $doaction ) { case 'trash': $trashed = $locked = 0; - foreach( (array) $post_ids as $post_id ) { + foreach ( (array) $post_ids as $post_id ) { if ( !current_user_can( 'delete_post', $post_id) ) wp_die( __('You are not allowed to move this item to the Trash.') ); @@ -111,7 +111,7 @@ if ( $doaction ) { break; case 'untrash': $untrashed = 0; - foreach( (array) $post_ids as $post_id ) { + foreach ( (array) $post_ids as $post_id ) { if ( !current_user_can( 'delete_post', $post_id) ) wp_die( __('You are not allowed to restore this item from the Trash.') ); @@ -124,7 +124,7 @@ if ( $doaction ) { break; case 'delete': $deleted = 0; - foreach( (array) $post_ids as $post_id ) { + foreach ( (array) $post_ids as $post_id ) { $post_del = get_post($post_id); if ( !current_user_can( 'delete_post', $post_id ) ) diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 5d1edecfbc..8015e628cd 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -868,7 +868,7 @@ class WP_List_Table { // We need a primary defined so responsive views show something, // so let's fall back to the first non-checkbox column. - foreach( $columns as $col => $column_name ) { + foreach ( $columns as $col => $column_name ) { if ( 'cb' === $col ) { continue; } diff --git a/wp-admin/includes/class-wp-press-this.php b/wp-admin/includes/class-wp-press-this.php index 58ed28661a..b1b7138c41 100644 --- a/wp-admin/includes/class-wp-press-this.php +++ b/wp-admin/includes/class-wp-press-this.php @@ -984,7 +984,7 @@ class WP_Press_This { } if ( ! empty( $data['_embeds'] ) ) { - foreach( $data['_embeds'] as $src ) { + foreach ( $data['_embeds'] as $src ) { $prot_relative_src = preg_replace( '/^https?:/', '', $src ); if ( in_array( $prot_relative_src, $this->embeds ) ) { @@ -1012,7 +1012,7 @@ class WP_Press_This { $selected_images = array(); if ( ! empty( $data['_images'] ) ) { - foreach( $data['_images'] as $src ) { + foreach ( $data['_images'] as $src ) { if ( false !== strpos( $src, 'gravatar.com' ) ) { $src = preg_replace( '%http://[\d]+\.gravatar\.com/%', 'https://secure.gravatar.com/', $src ); } diff --git a/wp-admin/includes/dashboard.php b/wp-admin/includes/dashboard.php index 49fcdd926b..9c7ac5b8ab 100644 --- a/wp-admin/includes/dashboard.php +++ b/wp-admin/includes/dashboard.php @@ -1069,7 +1069,7 @@ function wp_dashboard_primary() { * @param array $feeds Array of RSS feeds. */ function wp_dashboard_primary_output( $widget_id, $feeds ) { - foreach( $feeds as $type => $args ) { + foreach ( $feeds as $type => $args ) { $args['type'] = $type; echo '
'; if ( $type === 'plugins' ) { diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 2cdac29210..815a30988a 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -1239,7 +1239,7 @@ function get_attachment_fields_to_edit($post, $errors = null) { } // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default - // The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing ) + // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing ) $form_fields = array_merge_recursive($form_fields, (array) $errors); // This was formerly in image_attachment_fields_to_edit(). @@ -1627,7 +1627,7 @@ function get_compat_media_markup( $attachment_id, $args = null ) { } // Merge default fields with their errors, so any key passed with the error (e.g. 'error', 'helps', 'value') will replace the default - // The recursive merge is easily traversed with array casting: foreach( (array) $things as $thing ) + // The recursive merge is easily traversed with array casting: foreach ( (array) $things as $thing ) $form_fields = array_merge_recursive($form_fields, (array) $args['errors'] ); /** This filter is documented in wp-admin/includes/media.php */ diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index ffed184b21..7ea7cdfd9d 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -158,7 +158,7 @@ function wpmu_delete_blog( $blog_id, $drop = false ) { } $stack = array_reverse( $stack ); // Last added dirs are deepest - foreach( (array) $stack as $dir ) { + foreach ( (array) $stack as $dir ) { if ( $dir != $top_dir) @rmdir( $dir ); } @@ -802,7 +802,7 @@ function choose_primary_blog() { $found = false; ?> @@ -336,7 +336,7 @@ if ( ! /iPad|iPod|iPhone/.test( navigator.userAgent ) ) { $path_to_wp_config = dirname( ABSPATH ) . '/wp-config.php'; $handle = fopen( $path_to_wp_config, 'w' ); - foreach( $config_file as $line ) { + foreach ( $config_file as $line ) { fwrite( $handle, $line ); } fclose( $handle ); diff --git a/wp-admin/update-core.php b/wp-admin/update-core.php index b2f48c6693..0409c72f29 100644 --- a/wp-admin/update-core.php +++ b/wp-admin/update-core.php @@ -135,7 +135,7 @@ function dismissed_updates() { '.__('Show hidden updates').'

'; echo '