mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-26 10:11:29 +01:00
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]. Props ocean90. See #43757. Built from https://develop.svn.wordpress.org/branches/5.0@43850 git-svn-id: http://core.svn.wordpress.org/branches/5.0@43679 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
b277797add
commit
d5e3670372
@ -173,6 +173,7 @@ class WP_REST_Attachments_Controller extends WP_REST_Posts_Controller {
|
|||||||
do_action( 'rest_insert_attachment', $attachment, $request, true );
|
do_action( 'rest_insert_attachment', $attachment, $request, true );
|
||||||
|
|
||||||
// Include admin function to get access to wp_generate_attachment_metadata().
|
// 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';
|
require_once ABSPATH . 'wp-admin/includes/image.php';
|
||||||
|
|
||||||
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $file ) );
|
||||||
|
@ -4,7 +4,7 @@
|
|||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @global string $wp_version
|
||||||
*/
|
*/
|
||||||
$wp_version = '5.0-beta2-43849';
|
$wp_version = '5.0-beta2-43850';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
Loading…
Reference in New Issue
Block a user