Changeset 56193
- Timestamp:
- 07/10/2023 10:58:33 PM (17 months ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/customize/class-wp-customize-header-image-setting.php
r53411 r56193 46 46 } 47 47 48 // If the value doesn't exist (removed or random), 49 // use the header_image value. 48 /* 49 * If the value doesn't exist (removed or random), 50 * use the header_image value. 51 */ 50 52 if ( ! $value ) { 51 53 $value = $this->manager->get_setting( 'header_image' )->post_value(); -
trunk/src/wp-includes/customize/class-wp-customize-media-control.php
r50810 r56193 89 89 if ( is_object( $this->setting ) ) { 90 90 if ( $this->setting->default ) { 91 // Fake an attachment model - needs all fields used by template. 92 // Note that the default value must be a URL, NOT an attachment ID. 91 /* 92 * Fake an attachment model - needs all fields used by template. 93 * Note that the default value must be a URL, NOT an attachment ID. 94 */ 93 95 $ext = substr( $this->setting->default, -3 ); 94 96 $type = in_array( $ext, array( 'jpg', 'png', 'gif', 'bmp', 'webp' ), true ) ? 'image' : 'document'; -
trunk/src/wp-includes/customize/class-wp-customize-themes-section.php
r55276 r56193 185 185 */ 186 186 protected function filter_drawer_content_template() { 187 // @todo Use the .org API instead of the local core feature list. 188 // The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned. 187 /* 188 * @todo Use the .org API instead of the local core feature list. 189 * The .org API is currently outdated and will be reconciled when the .org themes directory is next redesigned. 190 */ 189 191 $feature_list = get_theme_feature_list( false ); 190 192 ?> -
trunk/src/wp-includes/rest-api/class-wp-rest-request.php
r55988 r56193 474 474 $params = array(); 475 475 foreach ( $order as $type ) { 476 // array_merge() / the "+" operator will mess up 477 // numeric keys, so instead do a manual foreach. 476 /* 477 * array_merge() / the "+" operator will mess up 478 * numeric keys, so instead do a manual foreach. 479 */ 478 480 foreach ( (array) $this->params[ $type ] as $key => $value ) { 479 481 $params[ $key ] = $value; -
trunk/src/wp-includes/rest-api/class-wp-rest-server.php
r56156 r56193 702 702 703 703 foreach ( $data['_links'] as $rel => $links ) { 704 // If a list of relations was specified, and the link relation 705 // is not in the list of allowed relations, don't process the link. 704 /* 705 * If a list of relations was specified, and the link relation 706 * is not in the list of allowed relations, don't process the link. 707 */ 706 708 if ( is_array( $embed ) && ! in_array( $rel, $embed, true ) ) { 707 709 continue; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php
r56168 r56193 203 203 204 204 if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { 205 // Set a custom header with the attachment_id. 206 // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 205 /* 206 * Set a custom header with the attachment_id. 207 * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 208 */ 207 209 header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); 208 210 } … … 212 214 require_once ABSPATH . 'wp-admin/includes/image.php'; 213 215 214 // Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta. 215 // At this point the server may run out of resources and post-processing of uploaded images may fail. 216 /* 217 * Post-process the upload (create image sub-sizes, make PDF thumbnails, etc.) and insert attachment meta. 218 * At this point the server may run out of resources and post-processing of uploaded images may fail. 219 */ 216 220 wp_update_attachment_metadata( $attachment_id, wp_generate_attachment_metadata( $attachment_id, $file ) ); 217 221 … … 563 567 $image_name = wp_basename( $image_file, ".{$image_ext}" ); 564 568 565 // Do not append multiple `-edited` to the file name. 566 // The user may be editing a previously edited image. 569 /* 570 * Do not append multiple `-edited` to the file name. 571 * The user may be editing a previously edited image. 572 */ 567 573 if ( preg_match( '/-edited(-\d+)?$/', $image_name ) ) { 568 574 // Remove any `-1`, `-2`, etc. `wp_unique_filename()` will add the proper number. … … 626 632 627 633 if ( defined( 'REST_REQUEST' ) && REST_REQUEST ) { 628 // Set a custom header with the attachment_id. 629 // Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 634 /* 635 * Set a custom header with the attachment_id. 636 * Used by the browser/client to resume creating image sub-sizes after a PHP fatal error. 637 */ 630 638 header( 'X-WP-Upload-Attachment-ID: ' . $new_attachment_id ); 631 639 } -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-autosaves-controller.php
r56163 r56193 230 230 231 231 if ( $is_draft && (int) $post->post_author === $user_id && ! $post_lock ) { 232 // Draft posts for the same author: autosaving updates the post and does not create a revision. 233 // Convert the post object to an array and add slashes, wp_update_post() expects escaped array. 232 /* 233 * Draft posts for the same author: autosaving updates the post and does not create a revision. 234 * Convert the post object to an array and add slashes, wp_update_post() expects escaped array. 235 */ 234 236 $autosave_id = wp_update_post( wp_slash( (array) $prepared_post ), true ); 235 237 } else { -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php
r54891 r56193 1762 1762 $posts_controller = $post_type->get_rest_controller(); 1763 1763 1764 // Ensure the posts controller is specifically a WP_REST_Posts_Controller instance 1765 // before using methods specific to that controller. 1764 /* 1765 * Ensure the posts controller is specifically a WP_REST_Posts_Controller instance 1766 * before using methods specific to that controller. 1767 */ 1766 1768 if ( ! $posts_controller instanceof WP_REST_Posts_Controller ) { 1767 1769 $posts_controller = new WP_REST_Posts_Controller( $post->post_type ); -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-controller.php
r55104 r56193 577 577 578 578 foreach ( $additional_fields as $field_name => $field_options ) { 579 // For back-compat, include any field with an empty schema 580 // because it won't be present in $this->get_item_schema(). 579 /* 580 * For back-compat, include any field with an empty schema 581 * because it won't be present in $this->get_item_schema(). 582 */ 581 583 if ( is_null( $field_options['schema'] ) ) { 582 584 $properties[ $field_name ] = $field_options; … … 631 633 // Check for nested fields if $field is not a direct match. 632 634 $nested_fields = explode( '.', $field ); 633 // A nested field is included so long as its top-level property 634 // is present in the schema. 635 /* 636 * A nested field is included so long as its top-level property 637 * is present in the schema. 638 */ 635 639 if ( in_array( $nested_fields[0], $fields, true ) ) { 636 640 $response_fields[] = $field; -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-global-styles-controller.php
r56105 r56193 62 62 '/%s/themes/(?P<stylesheet>%s)', 63 63 $this->rest_base, 64 // Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. 65 // Excludes invalid directory name characters: `/:<>*?"|`. 64 /* 65 * Matches theme's directory: `/themes/<subdirectory>/<theme>/` or `/themes/<theme>/`. 66 * Excludes invalid directory name characters: `/:<>*?"|`. 67 */ 66 68 '[^\/:<>\*\?"\|]+(?:\/[^\/:<>\*\?"\|]+)?' 67 69 ), … … 566 568 */ 567 569 public function get_theme_item_permissions_check( $request ) { 568 // Verify if the current user has edit_theme_options capability. 569 // This capability is required to edit/view/delete templates. 570 /* 571 * Verify if the current user has edit_theme_options capability. 572 * This capability is required to edit/view/delete templates. 573 */ 570 574 if ( ! current_user_can( 'edit_theme_options' ) ) { 571 575 return new WP_Error( … … 639 643 */ 640 644 public function get_theme_items_permissions_check( $request ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable 641 // Verify if the current user has edit_theme_options capability. 642 // This capability is required to edit/view/delete templates. 645 /* 646 * Verify if the current user has edit_theme_options capability. 647 * This capability is required to edit/view/delete templates. 648 */ 643 649 if ( ! current_user_can( 'edit_theme_options' ) ) { 644 650 return new WP_Error( -
trunk/src/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php
r55248 r56193 1064 1064 } 1065 1065 1066 // (Note that internally this falls through to `wp_delete_post()` 1067 // if the Trash is disabled.) 1066 /* 1067 * (Note that internally this falls through to `wp_delete_post()` 1068 * if the Trash is disabled.) 1069 */ 1068 1070 $result = wp_trash_post( $id ); 1069 1071 $post = get_post( $id ); … … 1270 1272 } 1271 1273 1272 // Sending a null date or date_gmt value resets date and date_gmt to their 1273 // default values (`0000-00-00 00:00:00`). 1274 /* 1275 * Sending a null date or date_gmt value resets date and date_gmt to their 1276 * default values (`0000-00-00 00:00:00`). 1277 */ 1274 1278 if ( 1275 1279 ( ! empty( $schema['properties']['date_gmt'] ) && $request->has_param( 'date_gmt' ) && null === $request['date_gmt'] ) ||
Note: See TracChangeset
for help on using the changeset viewer.