From b80ce60f7080da5241a267fe4ffad11feab7e92d Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Sat, 9 Sep 2023 09:28:26 +0000 Subject: [PATCH] Coding Standards: Use pre-increment/decrement for stand-alone statements. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Note: This is enforced by WPCS 3.0.0: 1. There should be no space between an increment/decrement operator and the variable it applies to. 2. Pre-increment/decrement should be favoured over post-increment/decrement for stand-alone statements. “Pre” will in/decrement and then return, “post” will return and then in/decrement. Using the “pre” version is slightly more performant and can prevent future bugs when code gets moved around. References: * [https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/#increment-decrement-operators WordPress PHP Coding Standards: Increment/decrement operators] * [https://github.com/WordPress/WordPress-Coding-Standards/pull/2130 WPCS: PR #2130 Core: add sniffs to check formatting of increment/decrement operators] Props jrf. See #59161, #58831. Built from https://develop.svn.wordpress.org/trunk@56549 git-svn-id: http://core.svn.wordpress.org/trunk@56061 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-admin/edit-comments.php | 14 ++++++------- wp-admin/edit.php | 8 ++++---- wp-admin/includes/ajax-actions.php | 6 +++--- .../includes/class-language-pack-upgrader.php | 2 +- wp-admin/includes/class-plugin-upgrader.php | 2 +- wp-admin/includes/class-theme-upgrader.php | 2 +- .../includes/class-wp-automatic-updater.php | 4 ++-- wp-admin/includes/class-wp-list-table.php | 2 +- .../includes/class-wp-plugins-list-table.php | 2 +- .../includes/class-wp-posts-list-table.php | 12 +++++------ .../class-wp-privacy-requests-table.php | 10 +++++----- wp-admin/includes/class-wp-site-health.php | 20 +++++++++---------- .../includes/class-wp-terms-list-table.php | 2 +- wp-admin/includes/file.php | 4 ++-- wp-admin/includes/image-edit.php | 2 +- wp-admin/includes/media.php | 2 +- wp-admin/includes/menu.php | 2 +- wp-admin/includes/misc.php | 4 ++-- wp-admin/includes/ms.php | 2 +- wp-admin/includes/template.php | 4 ++-- wp-admin/includes/upgrade.php | 2 +- wp-admin/includes/widgets.php | 4 ++-- wp-admin/link.php | 2 +- wp-admin/menu.php | 2 +- wp-admin/network/users.php | 2 +- wp-admin/users.php | 2 +- wp-admin/widgets-form.php | 4 ++-- wp-content/themes/twentyeleven/functions.php | 6 +++--- wp-content/themes/twentyeleven/image.php | 2 +- wp-content/themes/twentyeleven/showcase.php | 4 ++-- .../inc/template-functions.php | 2 +- .../themes/twentyten/loop-attachment.php | 2 +- wp-content/themes/twentytwelve/image.php | 2 +- wp-content/themes/twentytwenty/index.php | 2 +- .../inc/template-functions.php | 2 +- wp-includes/class-walker-comment.php | 2 +- wp-includes/class-wp-block.php | 2 +- wp-includes/class-wp-comment-query.php | 2 +- wp-includes/class-wp-customize-manager.php | 4 ++-- wp-includes/class-wp-hook.php | 4 ++-- wp-includes/class-wp-list-util.php | 4 ++-- wp-includes/class-wp-meta-query.php | 2 +- wp-includes/class-wp-query.php | 8 ++++---- wp-includes/class-wp-rewrite.php | 2 +- wp-includes/class-wp-theme-json.php | 4 ++-- wp-includes/class-wp-walker.php | 6 +++--- wp-includes/class-wpdb.php | 12 +++++------ wp-includes/comment-template.php | 4 ++-- wp-includes/compat.php | 2 +- wp-includes/formatting.php | 14 ++++++------- wp-includes/functions.php | 8 ++++---- .../html-api/class-wp-html-tag-processor.php | 6 +++--- wp-includes/media.php | 8 ++++---- wp-includes/ms-site.php | 2 +- wp-includes/pomo/mo.php | 2 +- wp-includes/pomo/plural-forms.php | 14 ++++++------- wp-includes/pomo/po.php | 8 ++++---- wp-includes/pomo/translations.php | 2 +- wp-includes/post.php | 8 ++++---- wp-includes/taxonomy.php | 2 +- wp-includes/theme-templates.php | 2 +- wp-includes/user.php | 6 +++--- wp-includes/version.php | 2 +- .../widgets/class-wp-widget-calendar.php | 2 +- wp-includes/widgets/class-wp-widget-media.php | 2 +- 65 files changed, 146 insertions(+), 146 deletions(-) diff --git a/wp-admin/edit-comments.php b/wp-admin/edit-comments.php index d7f14f2cd0..ffc1d58d8c 100644 --- a/wp-admin/edit-comments.php +++ b/wp-admin/edit-comments.php @@ -84,31 +84,31 @@ if ( $doaction ) { switch ( $doaction ) { case 'approve': wp_set_comment_status( $comment_id, 'approve' ); - $approved++; + ++$approved; break; case 'unapprove': wp_set_comment_status( $comment_id, 'hold' ); - $unapproved++; + ++$unapproved; break; case 'spam': wp_spam_comment( $comment_id ); - $spammed++; + ++$spammed; break; case 'unspam': wp_unspam_comment( $comment_id ); - $unspammed++; + ++$unspammed; break; case 'trash': wp_trash_comment( $comment_id ); - $trashed++; + ++$trashed; break; case 'untrash': wp_untrash_comment( $comment_id ); - $untrashed++; + ++$untrashed; break; case 'delete': wp_delete_comment( $comment_id ); - $deleted++; + ++$deleted; break; } } diff --git a/wp-admin/edit.php b/wp-admin/edit.php index b5ed3322ae..90b342330e 100644 --- a/wp-admin/edit.php +++ b/wp-admin/edit.php @@ -124,7 +124,7 @@ if ( $doaction ) { } if ( wp_check_post_lock( $post_id ) ) { - $locked++; + ++$locked; continue; } @@ -132,7 +132,7 @@ if ( $doaction ) { wp_die( __( 'Error in moving the item to Trash.' ) ); } - $trashed++; + ++$trashed; } $sendback = add_query_arg( @@ -160,7 +160,7 @@ if ( $doaction ) { wp_die( __( 'Error in restoring the item from Trash.' ) ); } - $untrashed++; + ++$untrashed; } $sendback = add_query_arg( 'untrashed', $untrashed, $sendback ); @@ -185,7 +185,7 @@ if ( $doaction ) { wp_die( __( 'Error in deleting the item.' ) ); } } - $deleted++; + ++$deleted; } $sendback = add_query_arg( 'deleted', $deleted, $sendback ); break; diff --git a/wp-admin/includes/ajax-actions.php b/wp-admin/includes/ajax-actions.php index 16b827d7bd..8aada30959 100644 --- a/wp-admin/includes/ajax-actions.php +++ b/wp-admin/includes/ajax-actions.php @@ -2149,7 +2149,7 @@ function wp_ajax_inline_save() { while ( $parent > 0 ) { $parent_post = get_post( $parent ); $parent = $parent_post->post_parent; - $level++; + ++$level; } } @@ -2211,7 +2211,7 @@ function wp_ajax_inline_save_tax() { while ( $parent > 0 ) { $parent_tag = get_term( $parent, $taxonomy ); $parent = $parent_tag->parent; - $level++; + ++$level; } $wp_list_table->single_row( $tag, $level ); @@ -2821,7 +2821,7 @@ function wp_ajax_set_attachment_thumbnail() { } if ( set_post_thumbnail( $post_id, $thumbnail_id ) ) { - $success++; + ++$success; } } diff --git a/wp-admin/includes/class-language-pack-upgrader.php b/wp-admin/includes/class-language-pack-upgrader.php index adeac200d4..3c3d42a56a 100644 --- a/wp-admin/includes/class-language-pack-upgrader.php +++ b/wp-admin/includes/class-language-pack-upgrader.php @@ -238,7 +238,7 @@ class Language_Pack_Upgrader extends WP_Upgrader { $destination .= '/themes'; } - $this->update_current++; + ++$this->update_current; $options = array( 'package' => $language_update->package, diff --git a/wp-admin/includes/class-plugin-upgrader.php b/wp-admin/includes/class-plugin-upgrader.php index 48eaee6390..02743f6456 100644 --- a/wp-admin/includes/class-plugin-upgrader.php +++ b/wp-admin/includes/class-plugin-upgrader.php @@ -330,7 +330,7 @@ class Plugin_Upgrader extends WP_Upgrader { $this->update_count = count( $plugins ); $this->update_current = 0; foreach ( $plugins as $plugin ) { - $this->update_current++; + ++$this->update_current; $this->skin->plugin_info = get_plugin_data( WP_PLUGIN_DIR . '/' . $plugin, false, true ); if ( ! isset( $current->response[ $plugin ] ) ) { diff --git a/wp-admin/includes/class-theme-upgrader.php b/wp-admin/includes/class-theme-upgrader.php index 688f8d612d..12bd477291 100644 --- a/wp-admin/includes/class-theme-upgrader.php +++ b/wp-admin/includes/class-theme-upgrader.php @@ -426,7 +426,7 @@ class Theme_Upgrader extends WP_Upgrader { $this->update_count = count( $themes ); $this->update_current = 0; foreach ( $themes as $theme ) { - $this->update_current++; + ++$this->update_current; $this->skin->theme_info = $this->theme_info( $theme ); diff --git a/wp-admin/includes/class-wp-automatic-updater.php b/wp-admin/includes/class-wp-automatic-updater.php index e835f0cd35..bb8cb402af 100644 --- a/wp-admin/includes/class-wp-automatic-updater.php +++ b/wp-admin/includes/class-wp-automatic-updater.php @@ -1390,7 +1390,7 @@ class WP_Automatic_Updater { } else { /* translators: %s: WordPress version. */ $body[] = sprintf( __( 'FAILED: WordPress failed to update to %s' ), $result->name ); - $failures++; + ++$failures; } $body[] = ''; @@ -1432,7 +1432,7 @@ class WP_Automatic_Updater { if ( ! $item->result || is_wp_error( $item->result ) ) { /* translators: %s: Name of plugin / theme / translation. */ $body[] = ' * ' . sprintf( __( 'FAILED: %s' ), $item->name ); - $failures++; + ++$failures; } } } diff --git a/wp-admin/includes/class-wp-list-table.php b/wp-admin/includes/class-wp-list-table.php index 3fa6f54dd4..8258ebf2a6 100644 --- a/wp-admin/includes/class-wp-list-table.php +++ b/wp-admin/includes/class-wp-list-table.php @@ -1410,7 +1410,7 @@ class WP_List_Table { '' . '' . ''; - $cb_counter++; + ++$cb_counter; } foreach ( $columns as $column_key => $column_display_name ) { diff --git a/wp-admin/includes/class-wp-plugins-list-table.php b/wp-admin/includes/class-wp-plugins-list-table.php index 56e76251da..b633fcd116 100644 --- a/wp-admin/includes/class-wp-plugins-list-table.php +++ b/wp-admin/includes/class-wp-plugins-list-table.php @@ -728,7 +728,7 @@ class WP_Plugins_List_Table extends WP_List_Table { $suffix = 2; while ( in_array( $plugin_id_attr, $plugin_id_attrs, true ) ) { $plugin_id_attr = "$plugin_slug-$suffix"; - $suffix++; + ++$suffix; } $plugin_id_attrs[] = $plugin_id_attr; diff --git a/wp-admin/includes/class-wp-posts-list-table.php b/wp-admin/includes/class-wp-posts-list-table.php index 6e9bcdc527..abb305f8e4 100644 --- a/wp-admin/includes/class-wp-posts-list-table.php +++ b/wp-admin/includes/class-wp-posts-list-table.php @@ -898,7 +898,7 @@ class WP_Posts_List_Table extends WP_List_Table { $to_display[ $page->ID ] = $level; } - $count++; + ++$count; if ( isset( $children_pages ) ) { $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); @@ -917,7 +917,7 @@ class WP_Posts_List_Table extends WP_List_Table { $to_display[ $op->ID ] = 0; } - $count++; + ++$count; } } } @@ -992,7 +992,7 @@ class WP_Posts_List_Table extends WP_List_Table { while ( $my_parent = array_pop( $my_parents ) ) { $to_display[ $my_parent->ID ] = $level - $num_parents; - $num_parents--; + --$num_parents; } } @@ -1000,7 +1000,7 @@ class WP_Posts_List_Table extends WP_List_Table { $to_display[ $page->ID ] = $level; } - $count++; + ++$count; $this->_page_rows( $children_pages, $count, $page->ID, $level + 1, $pagenum, $per_page, $to_display ); } @@ -1097,7 +1097,7 @@ class WP_Posts_List_Table extends WP_List_Table { break; } - $this->current_level++; + ++$this->current_level; $find_main_page = (int) $parent->post_parent; if ( ! isset( $parent_name ) ) { @@ -2085,7 +2085,7 @@ class WP_Posts_List_Table extends WP_List_Table { diff --git a/wp-admin/includes/class-wp-privacy-requests-table.php b/wp-admin/includes/class-wp-privacy-requests-table.php index cbc8c01892..e7ffeebd20 100644 --- a/wp-admin/includes/class-wp-privacy-requests-table.php +++ b/wp-admin/includes/class-wp-privacy-requests-table.php @@ -239,9 +239,9 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { $resend = _wp_privacy_resend_request( $request_id ); if ( $resend && ! is_wp_error( $resend ) ) { - $count++; + ++$count; } else { - $failures++; + ++$failures; } } @@ -286,7 +286,7 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { $result = _wp_privacy_completed_request( $request_id ); if ( $result && ! is_wp_error( $result ) ) { - $count++; + ++$count; } } @@ -309,9 +309,9 @@ abstract class WP_Privacy_Requests_Table extends WP_List_Table { case 'delete': foreach ( $request_ids as $request_id ) { if ( wp_delete_post( $request_id, true ) ) { - $count++; + ++$count; } else { - $failures++; + ++$failures; } } diff --git a/wp-admin/includes/class-wp-site-health.php b/wp-admin/includes/class-wp-site-health.php index 5ab784af40..6d87edee1b 100644 --- a/wp-admin/includes/class-wp-site-health.php +++ b/wp-admin/includes/class-wp-site-health.php @@ -381,14 +381,14 @@ class WP_Site_Health { // Loop over the available plugins and check their versions and active state. foreach ( $plugins as $plugin_path => $plugin ) { - $plugins_total++; + ++$plugins_total; if ( is_plugin_active( $plugin_path ) ) { - $plugins_active++; + ++$plugins_active; } if ( array_key_exists( $plugin_path, $plugin_updates ) ) { - $plugins_need_update++; + ++$plugins_need_update; } } @@ -543,21 +543,21 @@ class WP_Site_Health { } foreach ( $all_themes as $theme_slug => $theme ) { - $themes_total++; + ++$themes_total; if ( array_key_exists( $theme_slug, $theme_updates ) ) { - $themes_need_updates++; + ++$themes_need_updates; } } // If this is a child theme, increase the allowed theme count by one, to account for the parent. if ( is_child_theme() ) { - $allowed_theme_count++; + ++$allowed_theme_count; } // If there's a default theme installed and not in use, we count that as allowed as well. if ( $has_default_theme && ! $using_default_theme ) { - $allowed_theme_count++; + ++$allowed_theme_count; } if ( $themes_total > $allowed_theme_count ) { @@ -3293,11 +3293,11 @@ class WP_Site_Health { foreach ( $results as $result ) { if ( 'critical' === $result['status'] ) { - $site_status['critical']++; + ++$site_status['critical']; } elseif ( 'recommended' === $result['status'] ) { - $site_status['recommended']++; + ++$site_status['recommended']; } else { - $site_status['good']++; + ++$site_status['good']; } } diff --git a/wp-admin/includes/class-wp-terms-list-table.php b/wp-admin/includes/class-wp-terms-list-table.php index 9f2febedc2..8778e54200 100644 --- a/wp-admin/includes/class-wp-terms-list-table.php +++ b/wp-admin/includes/class-wp-terms-list-table.php @@ -310,7 +310,7 @@ class WP_Terms_List_Table extends WP_List_Table { while ( $my_parent = array_pop( $my_parents ) ) { echo "\t"; $this->single_row( $my_parent, $level - $num_parents ); - $num_parents--; + --$num_parents; } } diff --git a/wp-admin/includes/file.php b/wp-admin/includes/file.php index 94777598e8..aa8e25c8ed 100644 --- a/wp-admin/includes/file.php +++ b/wp-admin/includes/file.php @@ -1493,7 +1493,7 @@ function verify_file_signature( $filename, $signatures, $filename_for_errors = f // Ensure only valid-length signatures are considered. if ( SODIUM_CRYPTO_SIGN_BYTES !== strlen( $signature_raw ) ) { - $skipped_signature++; + ++$skipped_signature; continue; } @@ -1502,7 +1502,7 @@ function verify_file_signature( $filename, $signatures, $filename_for_errors = f // Only pass valid public keys through. if ( SODIUM_CRYPTO_SIGN_PUBLICKEYBYTES !== strlen( $key_raw ) ) { - $skipped_key++; + ++$skipped_key; continue; } diff --git a/wp-admin/includes/image-edit.php b/wp-admin/includes/image-edit.php index 58861b1a6f..4e97e90aca 100644 --- a/wp-admin/includes/image-edit.php +++ b/wp-admin/includes/image-edit.php @@ -979,7 +979,7 @@ function wp_save_image( $post_id ) { $new_path = "{$dirname}/$new_filename"; if ( file_exists( $new_path ) ) { - $suffix++; + ++$suffix; } else { break; } diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index cee19890a7..e7b4c10369 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -638,7 +638,7 @@ function wp_iframe( $content_func, ...$args ) { */ function media_buttons( $editor_id = 'content' ) { static $instance = 0; - $instance++; + ++$instance; $post = get_post(); diff --git a/wp-admin/includes/menu.php b/wp-admin/includes/menu.php index ae8e06be6e..da1b2ebf53 100644 --- a/wp-admin/includes/menu.php +++ b/wp-admin/includes/menu.php @@ -228,7 +228,7 @@ function add_menu_classes( $menu ) { $i = 0; foreach ( $menu as $order => $top ) { - $i++; + ++$i; if ( 0 === $order ) { // Dashboard is always shown/single. $menu[0][4] = add_cssclass( 'menu-top-first', $top[4] ); diff --git a/wp-admin/includes/misc.php b/wp-admin/includes/misc.php index 24cd26d661..3c55f3f59a 100644 --- a/wp-admin/includes/misc.php +++ b/wp-admin/includes/misc.php @@ -403,7 +403,7 @@ function wp_print_theme_file_tree( $tree, $level = 2, $size = 1, $index = 1 ) { $size = count( $tree ); foreach ( $tree as $label => $theme_file ) : - $index++; + ++$index; if ( ! is_array( $theme_file ) ) { wp_print_theme_file_tree( $theme_file, $level, $index, $size ); @@ -505,7 +505,7 @@ function wp_print_plugin_file_tree( $tree, $label = '', $level = 2, $size = 1, $ $size = count( $tree ); foreach ( $tree as $label => $plugin_file ) : - $index++; + ++$index; if ( ! is_array( $plugin_file ) ) { wp_print_plugin_file_tree( $plugin_file, $label, $level, $index, $size ); diff --git a/wp-admin/includes/ms.php b/wp-admin/includes/ms.php index 1e38133a3f..b52a50a2f9 100644 --- a/wp-admin/includes/ms.php +++ b/wp-admin/includes/ms.php @@ -734,7 +734,7 @@ function avoid_blog_page_permalink_collision( $data, $postarr ) { while ( $c < 10 && get_id_from_blogname( $post_name ) ) { $post_name .= mt_rand( 1, 10 ); - $c++; + ++$c; } if ( $post_name !== $data['post_name'] ) { diff --git a/wp-admin/includes/template.php b/wp-admin/includes/template.php index 6feac91493..0a3699672d 100644 --- a/wp-admin/includes/template.php +++ b/wp-admin/includes/template.php @@ -1355,7 +1355,7 @@ function do_meta_boxes( $screen, $context, $data_object ) { } } - $i++; + ++$i; // get_hidden_meta_boxes() doesn't apply in the block editor. $hidden_class = ( ! $screen->is_block_editor() && in_array( $box['id'], $hidden, true ) ) ? ' hide-if-js' : ''; echo '
' . "\n"; @@ -1550,7 +1550,7 @@ function do_accordion_sections( $screen, $context, $data_object ) { continue; } - $i++; + ++$i; $hidden_class = in_array( $box['id'], $hidden, true ) ? 'hide-if-js' : ''; $open_class = ''; diff --git a/wp-admin/includes/upgrade.php b/wp-admin/includes/upgrade.php index 0f08122239..bf0b12405d 100644 --- a/wp-admin/includes/upgrade.php +++ b/wp-admin/includes/upgrade.php @@ -1292,7 +1292,7 @@ function upgrade_230() { $num = 2; do { $alt_slug = $slug . "-$num"; - $num++; + ++$num; $slug_check = $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug ) ); } while ( $slug_check ); diff --git a/wp-admin/includes/widgets.php b/wp-admin/includes/widgets.php index 93979b6a25..682f596d94 100644 --- a/wp-admin/includes/widgets.php +++ b/wp-admin/includes/widgets.php @@ -134,7 +134,7 @@ function wp_list_widget_controls( $sidebar, $sidebar_name = '' ) { function wp_list_widget_controls_dynamic_sidebar( $params ) { global $wp_registered_widgets; static $i = 0; - $i++; + ++$i; $widget_id = $params[0]['widget_id']; $id = isset( $params[0]['_temp_id'] ) ? $params[0]['_temp_id'] : $widget_id; @@ -168,7 +168,7 @@ function next_widget_id_number( $id_base ) { $number = max( $number, $matches[1] ); } } - $number++; + ++$number; return $number; } diff --git a/wp-admin/link.php b/wp-admin/link.php index 084b1d7566..f07cc5897d 100644 --- a/wp-admin/link.php +++ b/wp-admin/link.php @@ -45,7 +45,7 @@ switch ( $action ) { $link_id = (int) $link_id; if ( wp_delete_link( $link_id ) ) { - $deleted++; + ++$deleted; } } diff --git a/wp-admin/menu.php b/wp-admin/menu.php index aa89f6c571..6a90772155 100644 --- a/wp-admin/menu.php +++ b/wp-admin/menu.php @@ -161,7 +161,7 @@ foreach ( array_merge( $builtin, $types ) as $ptype ) { */ $core_menu_positions = array( 59, 60, 65, 70, 75, 80, 85, 99 ); while ( isset( $menu[ $ptype_menu_position ] ) || in_array( $ptype_menu_position, $core_menu_positions, true ) ) { - $ptype_menu_position++; + ++$ptype_menu_position; } $menu[ $ptype_menu_position ] = array( esc_attr( $ptype_obj->labels->menu_name ), $ptype_obj->cap->edit_posts, $ptype_file, '', $menu_class, $ptype_menu_id, $menu_icon ); diff --git a/wp-admin/network/users.php b/wp-admin/network/users.php index 60ab967b94..d0b40e710d 100644 --- a/wp-admin/network/users.php +++ b/wp-admin/network/users.php @@ -184,7 +184,7 @@ if ( isset( $_GET['action'] ) ) { continue; } wpmu_delete_user( $id ); - $i++; + ++$i; } } diff --git a/wp-admin/users.php b/wp-admin/users.php index ec8886b61b..97b96a7b1a 100644 --- a/wp-admin/users.php +++ b/wp-admin/users.php @@ -381,7 +381,7 @@ switch ( $wp_list_table->current_action() ) { ); echo "\n"; - $go_delete++; + ++$go_delete; } } ?> diff --git a/wp-admin/widgets-form.php b/wp-admin/widgets-form.php index b77f23dbc3..aa01798856 100644 --- a/wp-admin/widgets-form.php +++ b/wp-admin/widgets-form.php @@ -310,7 +310,7 @@ if ( isset( $_GET['editwidget'] ) && $_GET['editwidget'] ) { } else { $j = count( $sidebars_widgets[ $sbname ] ); if ( isset( $_GET['addnew'] ) || ! in_array( $widget_id, $sidebars_widgets[ $sbname ], true ) ) { - $j++; + ++$j; } } $selected = ''; @@ -540,7 +540,7 @@ foreach ( $theme_sidebars as $sidebar => $registered_sidebar ) {
diff --git a/wp-content/themes/twentyeleven/functions.php b/wp-content/themes/twentyeleven/functions.php index f17bf729f3..4c478fd8e3 100644 --- a/wp-content/themes/twentyeleven/functions.php +++ b/wp-content/themes/twentyeleven/functions.php @@ -667,15 +667,15 @@ function twentyeleven_footer_sidebar_class() { $count = 0; if ( is_active_sidebar( 'sidebar-3' ) ) { - $count++; + ++$count; } if ( is_active_sidebar( 'sidebar-4' ) ) { - $count++; + ++$count; } if ( is_active_sidebar( 'sidebar-5' ) ) { - $count++; + ++$count; } $class = ''; diff --git a/wp-content/themes/twentyeleven/image.php b/wp-content/themes/twentyeleven/image.php index a727ea147a..973a249b5b 100644 --- a/wp-content/themes/twentyeleven/image.php +++ b/wp-content/themes/twentyeleven/image.php @@ -77,7 +77,7 @@ get_header(); ?> // If there is more than 1 attachment in a gallery... if ( count( $attachments ) > 1 ) { - $k++; + ++$k; if ( isset( $attachments[ $k ] ) ) { // ...get the URL of the next image attachment. $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); diff --git a/wp-content/themes/twentyeleven/showcase.php b/wp-content/themes/twentyeleven/showcase.php index c867b830d9..0821040f76 100644 --- a/wp-content/themes/twentyeleven/showcase.php +++ b/wp-content/themes/twentyeleven/showcase.php @@ -88,7 +88,7 @@ get_header(); ?> $featured->the_post(); // Increase the counter. - $counter_slider++; + ++$counter_slider; /* * We're going to add a class to our featured post for featured images. @@ -153,7 +153,7 @@ get_header(); ?> // Let's roll again. while ( $featured->have_posts() ) : $featured->the_post(); - $counter_slider++; + ++$counter_slider; if ( 1 === $counter_slider ) { $class = ' class="active"'; } else { diff --git a/wp-content/themes/twentyseventeen/inc/template-functions.php b/wp-content/themes/twentyseventeen/inc/template-functions.php index 2c2e9504cc..6b61eae85b 100644 --- a/wp-content/themes/twentyseventeen/inc/template-functions.php +++ b/wp-content/themes/twentyseventeen/inc/template-functions.php @@ -89,7 +89,7 @@ function twentyseventeen_panel_count() { // Create a setting and control for each of the sections available in the theme. for ( $i = 1; $i < ( 1 + $num_sections ); $i++ ) { if ( get_theme_mod( 'panel_' . $i ) ) { - $panel_count++; + ++$panel_count; } } diff --git a/wp-content/themes/twentyten/loop-attachment.php b/wp-content/themes/twentyten/loop-attachment.php index 007b5aa036..5c348d6cc7 100644 --- a/wp-content/themes/twentyten/loop-attachment.php +++ b/wp-content/themes/twentyten/loop-attachment.php @@ -107,7 +107,7 @@ if ( have_posts() ) { // If there is more than 1 image attachment in a gallery... if ( count( $attachments ) > 1 ) { - $k++; + ++$k; if ( isset( $attachments[ $k ] ) ) { // ...get the URL of the next image attachment. $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); diff --git a/wp-content/themes/twentytwelve/image.php b/wp-content/themes/twentytwelve/image.php index ffdde2c00d..c17067cb23 100644 --- a/wp-content/themes/twentytwelve/image.php +++ b/wp-content/themes/twentytwelve/image.php @@ -77,7 +77,7 @@ get_header(); ?> // If there is more than 1 attachment in a gallery... if ( count( $attachments ) > 1 ) : - $k++; + ++$k; if ( isset( $attachments[ $k ] ) ) : // ...get the URL of the next image attachment. $next_attachment_url = get_attachment_link( $attachments[ $k ]->ID ); diff --git a/wp-content/themes/twentytwenty/index.php b/wp-content/themes/twentytwenty/index.php index 0c73e812e3..9c7442c6e9 100644 --- a/wp-content/themes/twentytwenty/index.php +++ b/wp-content/themes/twentytwenty/index.php @@ -84,7 +84,7 @@ get_header(); $i = 0; while ( have_posts() ) { - $i++; + ++$i; if ( $i > 1 ) { echo ''; } diff --git a/wp-content/themes/twentytwentyone/inc/template-functions.php b/wp-content/themes/twentytwentyone/inc/template-functions.php index a862dfac14..5c1ca0f1e1 100644 --- a/wp-content/themes/twentytwentyone/inc/template-functions.php +++ b/wp-content/themes/twentytwentyone/inc/template-functions.php @@ -384,7 +384,7 @@ function twenty_twenty_one_print_first_instance_of_block( $block_name, $content if ( $is_matching_block ) { // Increment count. - $instances_count++; + ++$instances_count; // Add the block HTML. $blocks_content .= render_block( $block ); diff --git a/wp-includes/class-walker-comment.php b/wp-includes/class-walker-comment.php index 2aabcbd158..825a28334b 100644 --- a/wp-includes/class-walker-comment.php +++ b/wp-includes/class-walker-comment.php @@ -174,7 +174,7 @@ class Walker_Comment extends Walker { // Restores the more descriptive, specific name for use within this method. $comment = $data_object; - $depth++; + ++$depth; $GLOBALS['comment_depth'] = $depth; $GLOBALS['comment'] = $comment; diff --git a/wp-includes/class-wp-block.php b/wp-includes/class-wp-block.php index cdbc678f13..65d3af6a12 100644 --- a/wp-includes/class-wp-block.php +++ b/wp-includes/class-wp-block.php @@ -244,7 +244,7 @@ class WP_Block { $block_content .= $inner_block->render(); } - $index++; + ++$index; } } } diff --git a/wp-includes/class-wp-comment-query.php b/wp-includes/class-wp-comment-query.php index 40f2838966..9ebddd1c74 100644 --- a/wp-includes/class-wp-comment-query.php +++ b/wp-includes/class-wp-comment-query.php @@ -1079,7 +1079,7 @@ class WP_Comment_Query { wp_cache_set_multiple( $data, 'comment-queries' ); } - $level++; + ++$level; $levels[ $level ] = $child_ids; } while ( $child_ids ); diff --git a/wp-includes/class-wp-customize-manager.php b/wp-includes/class-wp-customize-manager.php index 77176609bc..0bceee3454 100644 --- a/wp-includes/class-wp-customize-manager.php +++ b/wp-includes/class-wp-customize-manager.php @@ -1077,7 +1077,7 @@ final class WP_Customize_Manager { continue; } if ( update_post_meta( $autosave_autodraft_post->ID, '_customize_restore_dismissed', true ) ) { - $dismissed++; + ++$dismissed; } } return $dismissed; @@ -1479,7 +1479,7 @@ final class WP_Customize_Manager { if ( ! $nav_menu_term_id ) { while ( isset( $changeset_data[ sprintf( 'nav_menu[%d]', $placeholder_id ) ] ) ) { - $placeholder_id--; + --$placeholder_id; } $nav_menu_term_id = $placeholder_id; $nav_menu_setting_id = sprintf( 'nav_menu[%d]', $placeholder_id ); diff --git a/wp-includes/class-wp-hook.php b/wp-includes/class-wp-hook.php index 8a6cdfd09f..9c1cac6d1c 100644 --- a/wp-includes/class-wp-hook.php +++ b/wp-includes/class-wp-hook.php @@ -317,7 +317,7 @@ final class WP_Hook implements Iterator, ArrayAccess { unset( $this->iterations[ $nesting_level ] ); unset( $this->current_priority[ $nesting_level ] ); - $this->nesting_level--; + --$this->nesting_level; return $value; } @@ -359,7 +359,7 @@ final class WP_Hook implements Iterator, ArrayAccess { } while ( false !== next( $this->iterations[ $nesting_level ] ) ); unset( $this->iterations[ $nesting_level ] ); - $this->nesting_level--; + --$this->nesting_level; } /** diff --git a/wp-includes/class-wp-list-util.php b/wp-includes/class-wp-list-util.php index c394f2c613..6560355291 100644 --- a/wp-includes/class-wp-list-util.php +++ b/wp-includes/class-wp-list-util.php @@ -117,12 +117,12 @@ class WP_List_Util { if ( is_array( $obj ) ) { // Treat object as an array. if ( array_key_exists( $m_key, $obj ) && ( $m_value == $obj[ $m_key ] ) ) { - $matched++; + ++$matched; } } elseif ( is_object( $obj ) ) { // Treat object as an object. if ( isset( $obj->{$m_key} ) && ( $m_value == $obj->{$m_key} ) ) { - $matched++; + ++$matched; } } } diff --git a/wp-includes/class-wp-meta-query.php b/wp-includes/class-wp-meta-query.php index 0c6867d84e..69dde01ff0 100644 --- a/wp-includes/class-wp-meta-query.php +++ b/wp-includes/class-wp-meta-query.php @@ -633,7 +633,7 @@ class WP_Meta_Query { $clause_key_base = $clause_key; while ( isset( $this->clauses[ $clause_key ] ) ) { $clause_key = $clause_key_base . '-' . $iterator; - $iterator++; + ++$iterator; } // Store the clause in our flat array. diff --git a/wp-includes/class-wp-query.php b/wp-includes/class-wp-query.php index 16e1cfc248..458b7898c2 100644 --- a/wp-includes/class-wp-query.php +++ b/wp-includes/class-wp-query.php @@ -3470,7 +3470,7 @@ class WP_Query { // Move to front, after other stickies. array_splice( $this->posts, $sticky_offset, 0, array( $sticky_post ) ); // Increment the sticky offset. The next sticky will be placed at this offset. - $sticky_offset++; + ++$sticky_offset; // Remove post from sticky posts array. $offset = array_search( $sticky_post->ID, $sticky_posts, true ); unset( $sticky_posts[ $offset ] ); @@ -3500,7 +3500,7 @@ class WP_Query { foreach ( $stickies as $sticky_post ) { array_splice( $this->posts, $sticky_offset, 0, array( $sticky_post ) ); - $sticky_offset++; + ++$sticky_offset; } } } @@ -3620,7 +3620,7 @@ class WP_Query { */ public function next_post() { - $this->current_post++; + ++$this->current_post; /** @var WP_Post */ $this->post = $this->posts[ $this->current_post ]; @@ -3730,7 +3730,7 @@ class WP_Query { * @return WP_Comment Comment object. */ public function next_comment() { - $this->current_comment++; + ++$this->current_comment; /** @var WP_Comment */ $this->comment = $this->comments[ $this->current_comment ]; diff --git a/wp-includes/class-wp-rewrite.php b/wp-includes/class-wp-rewrite.php index 150eabcbd8..8bcf8fc962 100644 --- a/wp-includes/class-wp-rewrite.php +++ b/wp-includes/class-wp-rewrite.php @@ -531,7 +531,7 @@ class WP_Rewrite { $front = $front . 'date/'; break; } - $tok_index++; + ++$tok_index; } $this->date_structure = $front . $date_endian; diff --git a/wp-includes/class-wp-theme-json.php b/wp-includes/class-wp-theme-json.php index b929c95608..227398facd 100644 --- a/wp-includes/class-wp-theme-json.php +++ b/wp-includes/class-wp-theme-json.php @@ -3399,7 +3399,7 @@ class WP_Theme_JSON { } if ( $below_midpoint_count < $steps_mid_point - 2 ) { - $x_small_count++; + ++$x_small_count; } $slug -= 10; @@ -3436,7 +3436,7 @@ class WP_Theme_JSON { } if ( $above_midpoint_count > 1 ) { - $x_large_count++; + ++$x_large_count; } $slug += 10; diff --git a/wp-includes/class-wp-walker.php b/wp-includes/class-wp-walker.php index 28cecfe79e..d8c00a3723 100644 --- a/wp-includes/class-wp-walker.php +++ b/wp-includes/class-wp-walker.php @@ -325,7 +325,7 @@ class Walker { $empty_array = array(); foreach ( $elements as $e ) { - $count++; + ++$count; if ( $count < $start ) { continue; } @@ -372,7 +372,7 @@ class Walker { } foreach ( $top_level_elements as $e ) { - $count++; + ++$count; // For the last page, need to unset earlier children in order to keep track of orphans. if ( $end >= $total_top && $count < $start ) { @@ -416,7 +416,7 @@ class Walker { foreach ( $elements as $e ) { if ( empty( $e->$parent_field ) ) { - $num++; + ++$num; } } return $num; diff --git a/wp-includes/class-wpdb.php b/wp-includes/class-wpdb.php index 1510d82a9f..39c467f031 100644 --- a/wp-includes/class-wpdb.php +++ b/wp-includes/class-wpdb.php @@ -1539,7 +1539,7 @@ class wpdb { $k = 1; $l = strlen( $s ); while ( $k <= $l && '%' === $s[ $l - $k ] ) { - $k++; + ++$k; } $placeholder = '%' . ( $k % 2 ? '%' : '' ) . $format . $type; @@ -1600,7 +1600,7 @@ class wpdb { $new_query .= $split_query[ $key - 2 ] . $split_query[ $key - 1 ] . $placeholder; $key += 3; - $arg_id++; + ++$arg_id; } // Replace $query; and add remaining $query characters, or index 0 if there were no placeholders. @@ -1632,7 +1632,7 @@ class wpdb { $used_placeholders[ $arg_pos ][] = $placeholder; $key += 3; - $arg_id++; + ++$arg_id; } $conflicts = array(); @@ -2304,7 +2304,7 @@ class wpdb { if ( $this->result instanceof mysqli_result ) { while ( $row = mysqli_fetch_object( $this->result ) ) { $this->last_result[ $num_rows ] = $row; - $num_rows++; + ++$num_rows; } } @@ -2334,7 +2334,7 @@ class wpdb { $this->result = mysqli_query( $this->dbh, $query ); } - $this->num_queries++; + ++$this->num_queries; if ( defined( 'SAVEQUERIES' ) && SAVEQUERIES ) { $this->log_query( @@ -3878,7 +3878,7 @@ class wpdb { $new_array = array(); foreach ( (array) $this->col_info as $col ) { $new_array[ $i ] = $col->{$info_type}; - $i++; + ++$i; } return $new_array; } else { diff --git a/wp-includes/comment-template.php b/wp-includes/comment-template.php index 59b2361d84..03f450dc9b 100644 --- a/wp-includes/comment-template.php +++ b/wp-includes/comment-template.php @@ -549,7 +549,7 @@ function get_comment_class( $css_class = '', $comment_id = null, $post = null ) $classes[] = 'even'; } - $comment_alt++; + ++$comment_alt; // Alt for top-level comments. if ( 1 == $comment_depth ) { @@ -559,7 +559,7 @@ function get_comment_class( $css_class = '', $comment_id = null, $post = null ) } else { $classes[] = 'thread-even'; } - $comment_thread_alt++; + ++$comment_thread_alt; } $classes[] = "depth-$comment_depth"; diff --git a/wp-includes/compat.php b/wp-includes/compat.php index 2b8de57bd7..5bfdbc23d6 100644 --- a/wp-includes/compat.php +++ b/wp-includes/compat.php @@ -203,7 +203,7 @@ function _mb_strlen( $str, $encoding = null ) { do { // We had some string left over from the last round, but we counted it in that last round. - $count--; + --$count; /* * Split by UTF-8 character, limit to 1000 characters (last array element will contain diff --git a/wp-includes/formatting.php b/wp-includes/formatting.php index be37097220..fddd2b1aa1 100644 --- a/wp-includes/formatting.php +++ b/wp-includes/formatting.php @@ -476,7 +476,7 @@ function wpautop( $text, $br = true ) { $pre_tags[ $name ] = substr( $text_part, $start ) . ''; $text .= substr( $text_part, 0, $start ) . $name; - $i++; + ++$i; } $text .= $last_part; @@ -2657,14 +2657,14 @@ function force_balance_tags( $text ) { } elseif ( $tagstack[ $stacksize - 1 ] === $tag ) { // Found closing tag. $tag = ''; // Close tag. array_pop( $tagstack ); - $stacksize--; + --$stacksize; } else { // Closing tag not at top, search for it. for ( $j = $stacksize - 1; $j >= 0; $j-- ) { if ( $tagstack[ $j ] === $tag ) { // Add tag to tagqueue. for ( $k = $stacksize - 1; $k >= $j; $k-- ) { $tagqueue .= ''; - $stacksize--; + --$stacksize; } break; } @@ -2692,7 +2692,7 @@ function force_balance_tags( $text ) { */ if ( $stacksize > 0 && ! in_array( $tag, $nestable_tags, true ) && $tagstack[ $stacksize - 1 ] === $tag ) { $tagqueue = ''; - $stacksize--; + --$stacksize; } $stacksize = array_push( $tagstack, $tag ); } @@ -3083,7 +3083,7 @@ function make_clickable( $text ) { || preg_match( '|^]|i', $piece ) || preg_match( '|^]|i', $piece ) ) { - $nested_code_pre++; + ++$nested_code_pre; } elseif ( $nested_code_pre && ( '' === strtolower( $piece ) || '' === strtolower( $piece ) @@ -3091,7 +3091,7 @@ function make_clickable( $text ) { || '' === strtolower( $piece ) ) ) { - $nested_code_pre--; + --$nested_code_pre; } if ( $nested_code_pre @@ -5354,7 +5354,7 @@ function wp_sprintf_l( $pattern, $args ) { $i = count( $args ); while ( $i ) { $arg = array_shift( $args ); - $i--; + --$i; if ( 0 === $i ) { $result .= $l['between_last_two'] . $arg; } else { diff --git a/wp-includes/functions.php b/wp-includes/functions.php index 4a2a2b1779..6963de3a38 100644 --- a/wp-includes/functions.php +++ b/wp-includes/functions.php @@ -2696,7 +2696,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) ); $number = $new_number; - $i++; + ++$i; } } } @@ -2769,7 +2769,7 @@ function wp_unique_filename( $dir, $filename, $unique_filename_callback = null ) ); $number = $new_number; - $i++; + ++$i; } } } @@ -7163,7 +7163,7 @@ function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pr $trace = debug_backtrace( false ); $caller = array(); $check_class = ! is_null( $ignore_class ); - $skip_frames++; // Skip this function. + ++$skip_frames; // Skip this function. if ( ! isset( $truncate_paths ) ) { $truncate_paths = array( @@ -7174,7 +7174,7 @@ function wp_debug_backtrace_summary( $ignore_class = null, $skip_frames = 0, $pr foreach ( $trace as $call ) { if ( $skip_frames > 0 ) { - $skip_frames--; + --$skip_frames; } elseif ( isset( $call['class'] ) ) { if ( $check_class && $ignore_class === $call['class'] ) { continue; // Filter out calls. diff --git a/wp-includes/html-api/class-wp-html-tag-processor.php b/wp-includes/html-api/class-wp-html-tag-processor.php index 2e84b3d719..541b5baf0b 100644 --- a/wp-includes/html-api/class-wp-html-tag-processor.php +++ b/wp-includes/html-api/class-wp-html-tag-processor.php @@ -951,7 +951,7 @@ class WP_HTML_Tag_Processor { if ( '/' === $this->html[ $at + 1 ] ) { $this->is_closing_tag = true; - $at++; + ++$at; } else { $this->is_closing_tag = false; } @@ -1020,7 +1020,7 @@ class WP_HTML_Tag_Processor { * * See https://html.spec.whatwg.org/#parse-error-incorrectly-closed-comment */ - $closer_at--; // Pre-increment inside condition below reduces risk of accidental infinite looping. + --$closer_at; // Pre-increment inside condition below reduces risk of accidental infinite looping. while ( ++$closer_at < strlen( $html ) ) { $closer_at = strpos( $html, '--', $closer_at ); if ( false === $closer_at ) { @@ -1101,7 +1101,7 @@ class WP_HTML_Tag_Processor { * See https://html.spec.whatwg.org/#parse-error-missing-end-tag-name */ if ( '>' === $html[ $at + 1 ] ) { - $at++; + ++$at; continue; } diff --git a/wp-includes/media.php b/wp-includes/media.php index d365e0b1e1..dd98b5e622 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -2552,7 +2552,7 @@ function gallery_shortcode( $attr ) { $post = get_post(); static $instance = 0; - $instance++; + ++$instance; if ( ! empty( $attr['ids'] ) ) { // 'ids' is explicitly ordered, unless you specify otherwise. @@ -2899,7 +2899,7 @@ function wp_playlist_shortcode( $attr ) { $post = get_post(); static $instance = 0; - $instance++; + ++$instance; if ( ! empty( $attr['ids'] ) ) { // 'ids' is explicitly ordered, unless you specify otherwise. @@ -3213,7 +3213,7 @@ function wp_audio_shortcode( $attr, $content = '' ) { $post_id = get_post() ? get_the_ID() : 0; static $instance = 0; - $instance++; + ++$instance; /** * Filters the default audio shortcode output. @@ -3432,7 +3432,7 @@ function wp_video_shortcode( $attr, $content = '' ) { $post_id = get_post() ? get_the_ID() : 0; static $instance = 0; - $instance++; + ++$instance; /** * Filters the default video shortcode output. diff --git a/wp-includes/ms-site.php b/wp-includes/ms-site.php index eaee99f568..65e7d8d78d 100644 --- a/wp-includes/ms-site.php +++ b/wp-includes/ms-site.php @@ -877,7 +877,7 @@ function wp_uninitialize_site( $site_id ) { } @closedir( $dh ); } - $index++; + ++$index; } $stack = array_reverse( $stack ); // Last added directories are deepest. diff --git a/wp-includes/pomo/mo.php b/wp-includes/pomo/mo.php index dec51cee31..1bbc40ab65 100644 --- a/wp-includes/pomo/mo.php +++ b/wp-includes/pomo/mo.php @@ -129,7 +129,7 @@ if ( ! class_exists( 'MO', false ) ) : // Headers' msgid is an empty string. fwrite( $fh, pack( 'VV', 0, $current_addr ) ); - $current_addr++; + ++$current_addr; $originals_table = "\0"; $reader = new POMO_Reader(); diff --git a/wp-includes/pomo/plural-forms.php b/wp-includes/pomo/plural-forms.php index b072bfadac..ae9c306d98 100644 --- a/wp-includes/pomo/plural-forms.php +++ b/wp-includes/pomo/plural-forms.php @@ -110,19 +110,19 @@ if ( ! class_exists( 'Plural_Forms', false ) ) : // Ignore whitespace. case ' ': case "\t": - $pos++; + ++$pos; break; // Variable (n). case 'n': $output[] = array( 'var' ); - $pos++; + ++$pos; break; // Parentheses. case '(': $stack[] = $next; - $pos++; + ++$pos; break; case ')': @@ -144,7 +144,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) : throw new Exception( 'Mismatched parentheses' ); } - $pos++; + ++$pos; break; // Operators. @@ -189,7 +189,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) : $o2 = $stack[ $s_pos ]; if ( '?' !== $o2 ) { $output[] = array( 'op', array_pop( $stack ) ); - $s_pos--; + --$s_pos; continue; } @@ -202,7 +202,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) : if ( ! $found ) { throw new Exception( 'Missing starting "?" ternary operator' ); } - $pos++; + ++$pos; break; // Default - number or invalid. @@ -264,7 +264,7 @@ if ( ! class_exists( 'Plural_Forms', false ) ) : $total = count( $this->tokens ); while ( $i < $total ) { $next = $this->tokens[ $i ]; - $i++; + ++$i; if ( 'var' === $next[0] ) { $stack[] = $n; continue; diff --git a/wp-includes/pomo/po.php b/wp-includes/pomo/po.php index 89d827c255..7b9ec0b88b 100644 --- a/wp-includes/pomo/po.php +++ b/wp-includes/pomo/po.php @@ -342,7 +342,7 @@ if ( ! class_exists( 'PO', false ) ) : $context = ''; $msgstr_index = 0; while ( true ) { - $lineno++; + ++$lineno; $line = PO::read_line( $f ); if ( ! $line ) { if ( feof( $f ) ) { @@ -365,7 +365,7 @@ if ( ! class_exists( 'PO', false ) ) : // The comment is the start of a new entry. if ( self::is_final( $context ) ) { PO::read_line( $f, 'put-back' ); - $lineno--; + --$lineno; break; } // Comments have to be at the beginning. @@ -377,7 +377,7 @@ if ( ! class_exists( 'PO', false ) ) : } elseif ( preg_match( '/^msgctxt\s+(".*")/', $line, $m ) ) { if ( self::is_final( $context ) ) { PO::read_line( $f, 'put-back' ); - $lineno--; + --$lineno; break; } if ( $context && 'comment' !== $context ) { @@ -388,7 +388,7 @@ if ( ! class_exists( 'PO', false ) ) : } elseif ( preg_match( '/^msgid\s+(".*")/', $line, $m ) ) { if ( self::is_final( $context ) ) { PO::read_line( $f, 'put-back' ); - $lineno--; + --$lineno; break; } if ( $context && 'msgctxt' !== $context && 'comment' !== $context ) { diff --git a/wp-includes/pomo/translations.php b/wp-includes/pomo/translations.php index d3a1d3cbd0..a5534a8ea9 100644 --- a/wp-includes/pomo/translations.php +++ b/wp-includes/pomo/translations.php @@ -261,7 +261,7 @@ if ( ! class_exists( 'Translations', false ) ) : switch ( $char ) { case '?': $res .= ' ? ('; - $depth++; + ++$depth; break; case ':': $res .= ') : ('; diff --git a/wp-includes/post.php b/wp-includes/post.php index 5d7aee24ee..2a8d6b41f6 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -5073,7 +5073,7 @@ function wp_unique_post_slug( $slug, $post_id, $post_status, $post_type, $post_p do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_id ) ); - $suffix++; + ++$suffix; } while ( $post_name_check ); $slug = $alt_post_name; } @@ -5110,7 +5110,7 @@ function wp_unique_post_slug( $slug, $post_id, $post_status, $post_type, $post_p do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_id, $post_parent ) ); - $suffix++; + ++$suffix; } while ( $post_name_check ); $slug = $alt_post_name; } @@ -5166,7 +5166,7 @@ function wp_unique_post_slug( $slug, $post_id, $post_status, $post_type, $post_p do { $alt_post_name = _truncate_post_slug( $slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $post_name_check = $wpdb->get_var( $wpdb->prepare( $check_sql, $alt_post_name, $post_type, $post_id ) ); - $suffix++; + ++$suffix; } while ( $post_name_check ); $slug = $alt_post_name; } @@ -5758,7 +5758,7 @@ function get_page_by_path( $page_path, $output = OBJECT, $post_type = 'page' ) { * ensuring each matches the post ancestry. */ while ( 0 != $p->post_parent && isset( $pages[ $p->post_parent ] ) ) { - $count++; + ++$count; $parent = $pages[ $p->post_parent ]; if ( ! isset( $revparts[ $count ] ) || $parent->post_name != $revparts[ $count ] ) { break; diff --git a/wp-includes/taxonomy.php b/wp-includes/taxonomy.php index 52a5705331..3eb36552e6 100644 --- a/wp-includes/taxonomy.php +++ b/wp-includes/taxonomy.php @@ -3090,7 +3090,7 @@ function wp_unique_term_slug( $slug, $term ) { $num = 2; do { $alt_slug = $slug . "-$num"; - $num++; + ++$num; $slug_check = $wpdb->get_var( $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $alt_slug ) ); } while ( $slug_check ); $slug = $alt_slug; diff --git a/wp-includes/theme-templates.php b/wp-includes/theme-templates.php index 114d7205d4..2f233ca1d1 100644 --- a/wp-includes/theme-templates.php +++ b/wp-includes/theme-templates.php @@ -90,7 +90,7 @@ function wp_filter_wp_template_unique_post_slug( $override_slug, $slug, $post_id $alt_post_name = _truncate_post_slug( $override_slug, 200 - ( strlen( $suffix ) + 1 ) ) . "-$suffix"; $query_args['post_name__in'] = array( $alt_post_name ); $query = new WP_Query( $query_args ); - $suffix++; + ++$suffix; } while ( count( $query->posts ) > 0 ); $override_slug = $alt_post_name; } diff --git a/wp-includes/user.php b/wp-includes/user.php index 5f8fe38071..aaba3a7e7e 100644 --- a/wp-includes/user.php +++ b/wp-includes/user.php @@ -1316,11 +1316,11 @@ function count_users( $strategy = 'time', $site_id = null ) { continue; } if ( empty( $b_roles ) ) { - $avail_roles['none']++; + ++$avail_roles['none']; } foreach ( $b_roles as $b_role => $val ) { if ( isset( $avail_roles[ $b_role ] ) ) { - $avail_roles[ $b_role ]++; + ++$avail_roles[ $b_role ]; } else { $avail_roles[ $b_role ] = 1; } @@ -2177,7 +2177,7 @@ function wp_insert_user( $userdata ) { $base_length = 49 - mb_strlen( $suffix ); $alt_user_nicename = mb_substr( $user_nicename, 0, $base_length ) . "-$suffix"; $user_nicename_check = $wpdb->get_var( $wpdb->prepare( "SELECT ID FROM $wpdb->users WHERE user_nicename = %s AND user_login != %s LIMIT 1", $alt_user_nicename, $user_login ) ); - $suffix++; + ++$suffix; } $user_nicename = $alt_user_nicename; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 732920ba33..297e04ab42 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.4-alpha-56548'; +$wp_version = '6.4-alpha-56549'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. diff --git a/wp-includes/widgets/class-wp-widget-calendar.php b/wp-includes/widgets/class-wp-widget-calendar.php index 6ab373fc42..9103934173 100644 --- a/wp-includes/widgets/class-wp-widget-calendar.php +++ b/wp-includes/widgets/class-wp-widget-calendar.php @@ -66,7 +66,7 @@ class WP_Widget_Calendar extends WP_Widget { echo ''; echo $args['after_widget']; - self::$instance++; + ++self::$instance; } /** diff --git a/wp-includes/widgets/class-wp-widget-media.php b/wp-includes/widgets/class-wp-widget-media.php index ebca22ec66..2352ae837b 100644 --- a/wp-includes/widgets/class-wp-widget-media.php +++ b/wp-includes/widgets/class-wp-widget-media.php @@ -373,7 +373,7 @@ abstract class WP_Widget_Media extends WP_Widget { $use_count = 0; foreach ( $this->get_settings() as $instance ) { if ( isset( $instance['attachment_id'] ) && $instance['attachment_id'] === $post->ID ) { - $use_count++; + ++$use_count; } }