REST API: Restore access to audio/video metadata functions.

Ensures `wp_read_video_metadata()`/`wp_read_audio_metadata()` functions are available when uploading video and audio. Fixes error introduced in [43589].

Merges [43850] from the 5.0 branch to trunk.

Props ocean90.
See #43757.

Built from https://develop.svn.wordpress.org/trunk@44216


git-svn-id: http://core.svn.wordpress.org/trunk@44046 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2018-12-16 01:26:53 +00:00
parent c9f8525211
commit e42dd489bc
2 changed files with 2 additions and 1 deletions

View File

@ -173,6 +173,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
do_action( 'rest_insert_attachment', $attachment, $request, true );
// Include admin function to get access to wp_generate_attachment_metadata().
require_once ABSPATH . 'wp-admin/includes/media.php';
require_once ABSPATH . 'wp-admin/includes/image.php';
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );

View File

@ -13,7 +13,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.1-alpha-44215';
$wp_version = '5.1-alpha-44216';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.