Make WordPress Core

Ticket #43757: 43757.2.diff

File 43757.2.diff, 1.5 KB (added by pratikthink, 7 years ago)

added correct sentence for comment

  • wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

     
    169169                 */
    170170                do_action( 'rest_insert_attachment', $attachment, $request, true );
    171171
    172                 // Include admin functions to get access to wp_generate_attachment_metadata().
    173                 require_once ABSPATH . 'wp-admin/includes/admin.php';
     172                // Include admin function to get access to wp_generate_attachment_metadata().
     173                require_once ABSPATH . 'wp-admin/includes/image.php';
    174174
    175175                wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
    176176
     
    514514                $type = array_shift( $headers['content_type'] );
    515515
    516516                /** Include admin functions to get access to wp_tempnam() and wp_handle_sideload() */
    517                 require_once ABSPATH . 'wp-admin/includes/admin.php';
     517                require_once ABSPATH . 'wp-admin/includes/file.php';
    518518
    519519                // Save the file.
    520520                $tmpfname = wp_tempnam( $filename );
     
    703703                        $overrides['action'] = 'wp_handle_mock_upload';
    704704                }
    705705
    706                 /** Include admin functions to get access to wp_handle_upload() */
    707                 require_once ABSPATH . 'wp-admin/includes/admin.php';
     706                /** Include admin function to get access to wp_handle_upload() */
     707                require_once ABSPATH . 'wp-admin/includes/file.php';
    708708
    709709                $file = wp_handle_upload( $files['file'], $overrides );
    710710