From f8d166454497b532675640ae0b963f3a9ebbccfc Mon Sep 17 00:00:00 2001 From: Sergey Biryukov Date: Mon, 17 Feb 2020 03:11:50 +0000 Subject: [PATCH] Docs: Improve inline comments for `require_once()` calls in `WP_REST_Attachments_Controller`. See #49449, #48303. git-svn-id: https://develop.svn.wordpress.org/trunk@47295 602fd350-edb4-49c9-b593-d223f7449a82 --- .../endpoints/class-wp-rest-attachments-controller.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php index 91b21587b1..59cb3ed182 100644 --- a/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php +++ b/src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php @@ -185,7 +185,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { header( 'X-WP-Upload-Attachment-ID: ' . $attachment_id ); } - // Include admin function to get access to wp_generate_attachment_metadata(). + // Include media functions to get access to wp_generate_attachment_metadata(). require_once ABSPATH . 'wp-admin/includes/media.php'; // Post-process the upload (create image sub-sizes, make PDF thumbnalis, etc.) and insert attachment meta. @@ -717,7 +717,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { // Get the content-type. $type = array_shift( $headers['content_type'] ); - /** Include admin functions to get access to wp_tempnam() and wp_handle_sideload(). */ + // Include filesystem functions to get access to wp_tempnam() and wp_handle_sideload(). require_once ABSPATH . 'wp-admin/includes/file.php'; // Save the file. @@ -915,7 +915,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { return $size_check; } - /** Include admin function to get access to wp_handle_upload(). */ + // Include filesystem functions to get access to wp_handle_upload(). require_once ABSPATH . 'wp-admin/includes/file.php'; $file = wp_handle_upload( $files['file'], $overrides ); @@ -997,7 +997,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller { ); } - // Include admin function to get access to upload_is_user_over_quota(). + // Include multisite admin functions to get access to upload_is_user_over_quota(). require_once ABSPATH . 'wp-admin/includes/ms.php'; if ( upload_is_user_over_quota( false ) ) {