Make WordPress Core

Ticket #43757: 43757.4.diff

File 43757.4.diff, 721 bytes (added by ocean90, 6 years ago)
  • src/wp-includes/rest-api/endpoints/class-wp-rest-attachments-controller.php

     
    173173                do_action( 'rest_insert_attachment', $attachment, $request, true );
    174174
    175175                // Include admin function to get access to wp_generate_attachment_metadata().
     176                require_once ABSPATH . 'wp-admin/includes/media.php';
    176177                require_once ABSPATH . 'wp-admin/includes/image.php';
    177178
    178179                wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );