diff --git a/wp-includes/customize/class-wp-customize-header-image-setting.php b/wp-includes/customize/class-wp-customize-header-image-setting.php index d3792e0d14..80333a5412 100644 --- a/wp-includes/customize/class-wp-customize-header-image-setting.php +++ b/wp-includes/customize/class-wp-customize-header-image-setting.php @@ -45,8 +45,10 @@ final class WP_Customize_Header_Image_Setting extends WP_Customize_Setting { $custom_image_header = new Custom_Image_Header( $admin_head_callback, $admin_preview_callback ); } - // If the value doesn't exist (removed or random), - // use the header_image value. + /* + * If the value doesn't exist (removed or random), + * use the header_image value. + */ if ( ! $value ) { $value = $this->manager->get_setting( 'header_image' )->post_value(); } diff --git a/wp-includes/customize/class-wp-customize-media-control.php b/wp-includes/customize/class-wp-customize-media-control.php index 22bf75dad5..f636892925 100644 --- a/wp-includes/customize/class-wp-customize-media-control.php +++ b/wp-includes/customize/class-wp-customize-media-control.php @@ -88,8 +88,10 @@ class WP_Customize_Media_Control extends WP_Customize_Control { if ( is_object( $this->setting ) ) { if ( $this->setting->default ) { - // Fake an attachment model - needs all fields used by template. - // Note that the default value must be a URL, NOT an attachment ID. + /* + * Fake an attachment model - needs all fields used by template. + * Note that the default value must be a URL, NOT an attachment ID. + */ $ext = substr( $this->setting->default, -3 ); $type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp', 'webp' ), true ) ? 'image' : 'document'; diff --git a/wp-includes/customize/class-wp-customize-themes-section.php b/wp-includes/customize/class-wp-customize-themes-section.php index 68ff146c67..81503f080f 100644 --- a/wp-includes/customize/class-wp-customize-themes-section.php +++ b/wp-includes/customize/class-wp-customize-themes-section.php @@ -184,8 +184,10 @@ class WP_Customize_Themes_Section extends WP_Customize_Section { * @since 4.9.0 */ protected function filter_drawer_content_template() { - // @todo Use the .org API instead of the local core feature list. - // The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned. + /* + * @todo Use the .org API instead of the local core feature list. + * The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned. + */ $feature_list = get_theme_feature_list( false ); ?> <# if ( 'wporg' === data.action ) { #> diff --git a/wp-includes/rest-api/class-wp-rest-request.php b/wp-includes/rest-api/class-wp-rest-request.php index 28b1288acd..c671fd3d13 100644 --- a/wp-includes/rest-api/class-wp-rest-request.php +++ b/wp-includes/rest-api/class-wp-rest-request.php @@ -473,8 +473,10 @@ class WP_REST_Request implements ArrayAccess { $params = array(); foreach ( $order as $type ) { - // array_merge() / the "+" operator will mess up - // numeric keys, so instead do a manual foreach. + /* + * array_merge() / the "+" operator will mess up + * numeric keys, so instead do a manual foreach. + */ foreach ( (array) $this->params[ $type ] as $key => $value ) { $params[ $key ] = $value; } diff --git a/wp-includes/rest-api/class-wp-rest-server.php b/wp-includes/rest-api/class-wp-rest-server.php index ff4cf3ec17..9df4556ada 100644 --- a/wp-includes/rest-api/class-wp-rest-server.php +++ b/wp-includes/rest-api/class-wp-rest-server.php @@ -701,8 +701,10 @@ class WP_REST_Server { $embedded = array(); foreach ( $data['_links'] as $rel => $links ) { - // If a list of relations was specified, and the link relation - // is not in the list of allowed relations, don't process the link. + /* + * If a list of relations was specified, and the link relation + * is not in the list of allowed relations, don't process the link. + */ if ( is_array( $embed ) && ! in_array( $rel, $embed, true ) ) { continue; } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index 09eae58f23..138440e8c2 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -202,8 +202,10 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { wp_after_insert_post( $attachment, false, null ); if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { - // Set a custom header with the attachment_id. - // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. + /* + * Set a custom header with the attachment_id. + * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. + */ header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); } @@ -211,8 +213,10 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { require_once ABSPATH . 'wp-admin/includes/media.php'; require_once ABSPATH . 'wp-admin/includes/image.php'; - // Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta. - // At this point the server may run out of resources and post-processing of uploaded images may fail. + /* + * Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta. + * At this point the server may run out of resources and post-processing of uploaded images may fail. + */ wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); $response = $this->prepare_item_for_response( $attachment, $request ); @@ -562,8 +566,10 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { $image_ext = pathinfo( $image_file, PATHINFO_EXTENSION ); $image_name = wp_basename( $image_file, ".{$image_ext}" ); - // Do not append multiple `-edited` to the file name. - // The user may be editing a previously edited image. + /* + * Do not append multiple `-edited` to the file name. + * The user may be editing a previously edited image. + */ if ( preg_match( '/-edited(-\d+)?$/', $image_name ) ) { // Remove any `-1`, `-2`, etc. `wp_unique_filename()` will add the proper number. $image_name = preg_replace( '/-edited(-\d+)?$/', '-edited', $image_name ); @@ -625,8 +631,10 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { } if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { - // Set a custom header with the attachment_id. - // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. + /* + * Set a custom header with the attachment_id. + * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. + */ header( 'X-WP-Upload-Attachment-ID: ' . $new_attachment_id ); } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php index 1eacba38e8..3ebed0752b 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php @@ -229,8 +229,10 @@ class WP_REST_Autosaves_Controller extends WP_REST_Revisions_Controller { $is_draft = 'draft' === $post->post_status || 'auto-draft' === $post->post_status; if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock ) { - // Draft posts for the same author: autosaving updates the post and does not create a revision. - // Convert the post object to an array and add slashes, wp_update_post() expects escaped array. + /* + * Draft posts for the same author: autosaving updates the post and does not create a revision. + * Convert the post object to an array and add slashes, wp_update_post() expects escaped array. + */ $autosave_id = wp_update_post( wp_slash( (array) $prepared_post ), true ); } else { // Non-draft posts: create or update the post autosave. diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php index 6fecfd3961..cf2c4d5f91 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php @@ -1761,8 +1761,10 @@ class WP_REST_Comments_Controller extends WP_REST_Controller { $posts_controller = $post_type->get_rest_controller(); - // Ensure the posts controller is specifically a WP_REST_Posts_Controller instance - // before using methods specific to that controller. + /* + * Ensure the posts controller is specifically a WP_REST_Posts_Controller instance + * before using methods specific to that controller. + */ if ( ! $posts_controller instanceof WP_REST_Posts_Controller ) { $posts_controller = new WP_REST_Posts_Controller( $post->post_type ); } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php index 9441aee509..81fc991ba9 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-controller.php @@ -576,8 +576,10 @@ abstract class WP_REST_Controller { $additional_fields = $this->get_additional_fields(); foreach ( $additional_fields as $field_name => $field_options ) { - // For back-compat, include any field with an empty schema - // because it won't be present in $this->get_item_schema(). + /* + * For back-compat, include any field with an empty schema + * because it won't be present in $this->get_item_schema(). + */ if ( is_null( $field_options['schema'] ) ) { $properties[ $field_name ] = $field_options; } @@ -630,8 +632,10 @@ abstract class WP_REST_Controller { } // Check for nested fields if $field is not a direct match. $nested_fields = explode( '.', $field ); - // A nested field is included so long as its top-level property - // is present in the schema. + /* + * A nested field is included so long as its top-level property + * is present in the schema. + */ if ( in_array( $nested_fields[0], $fields, true ) ) { $response_fields[] = $field; } diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php index cccb7b3a3d..0315cd23cf 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php @@ -61,8 +61,10 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { sprintf( '/%s/themes/(?P%s)', $this->rest_base, - // Matches theme's directory: `/themes///` or `/themes//`. - // Excludes invalid directory name characters: `/:<>*?"|`. + /* + * Matches theme's directory: `/themes///` or `/themes//`. + * Excludes invalid directory name characters: `/:<>*?"|`. + */ '[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?' ), array( @@ -565,8 +567,10 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_theme_item_permissions_check( $request ) { - // Verify if the current user has edit_theme_options capability. - // This capability is required to edit/view/delete templates. + /* + * Verify if the current user has edit_theme_options capability. + * This capability is required to edit/view/delete templates. + */ if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_global_styles', @@ -638,8 +642,10 @@ class WP_REST_Global_Styles_Controller extends WP_REST_Controller { * @return true|WP_Error True if the request has read access for the item, WP_Error object otherwise. */ public function get_theme_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable - // Verify if the current user has edit_theme_options capability. - // This capability is required to edit/view/delete templates. + /* + * Verify if the current user has edit_theme_options capability. + * This capability is required to edit/view/delete templates. + */ if ( ! current_user_can( 'edit_theme_options' ) ) { return new WP_Error( 'rest_cannot_manage_global_styles', diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 76ca226c59..4ec972347f 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -1063,8 +1063,10 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { ); } - // (Note that internally this falls through to `wp_delete_post()` - // if the Trash is disabled.) + /* + * (Note that internally this falls through to `wp_delete_post()` + * if the Trash is disabled.) + */ $result = wp_trash_post( $id ); $post = get_post( $id ); $response = $this->prepare_item_for_response( $post, $request ); @@ -1269,8 +1271,10 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { } } - // Sending a null date or date_gmt value resets date and date_gmt to their - // default values (`0000-00-00 00:00:00`). + /* + * Sending a null date or date_gmt value resets date and date_gmt to their + * default values (`0000-00-00 00:00:00`). + */ if ( ( ! empty( $schema['properties']['date_gmt'] ) && $request->has_param( 'date_gmt' ) && null === $request['date_gmt'] ) || ( ! empty( $schema['properties']['date'] ) && $request->has_param( 'date' ) && null === $request['date'] ) diff --git a/wp-includes/version.php b/wp-includes/version.php index a9f8788843..61e56124a7 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.3-beta3-56192'; +$wp_version = '6.3-beta3-56193'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.