In deprecated media iframe code, attachment_fields_to_save
filter should not be called twice after initial image upload in post.
Props SergeyBiryukov. Fixes #20720. git-svn-id: https://develop.svn.wordpress.org/trunk@28871 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
119add95d9
commit
2371f75688
@ -773,7 +773,10 @@ function wp_media_upload_handler() {
|
|||||||
return media_send_to_editor($html);
|
return media_send_to_editor($html);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( !empty($_POST) ) {
|
if ( isset( $_POST['save'] ) ) {
|
||||||
|
$errors['upload_notice'] = __('Saved.');
|
||||||
|
return media_upload_gallery();
|
||||||
|
} elseif ( ! empty( $_POST ) ) {
|
||||||
$return = media_upload_form_handler();
|
$return = media_upload_form_handler();
|
||||||
|
|
||||||
if ( is_string($return) )
|
if ( is_string($return) )
|
||||||
@ -782,11 +785,6 @@ function wp_media_upload_handler() {
|
|||||||
$errors = $return;
|
$errors = $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( isset($_POST['save']) ) {
|
|
||||||
$errors['upload_notice'] = __('Saved.');
|
|
||||||
return media_upload_gallery();
|
|
||||||
}
|
|
||||||
|
|
||||||
if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) {
|
if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' ) {
|
||||||
$type = 'image';
|
$type = 'image';
|
||||||
if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ) ) )
|
if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ) ) )
|
||||||
|
Loading…
Reference in New Issue
Block a user