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
This commit is contained in:
Sergey Biryukov 2020-02-17 03:11:50 +00:00
parent 96f845d1a7
commit f8d1664544

View File

@ -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 ) ) {