-/**
- * {@internal Missing Short Description}}
- *
- * @since 2.5.0
- *
- * @return unknown
- */
-function media_upload_audio() {
- $errors = array();
- $id = 0;
-
- if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
- // Upload File button was clicked
- $id = media_handle_upload('async-upload', $_REQUEST['post_id']);
- unset($_FILES);
- if ( is_wp_error($id) ) {
- $errors['upload_error'] = $id;
- $id = false;
- }
- }
-
- if ( !empty($_POST['insertonlybutton']) ) {
- $href = $_POST['insertonly']['href'];
- if ( !empty($href) && !strpos($href, '://') )
- $href = "http://$href";
-
- $title = esc_attr($_POST['insertonly']['title']);
- if ( empty($title) )
- $title = esc_attr( basename($href) );
-
- if ( !empty($title) && !empty($href) )
- $html = "<a href='" . esc_url($href) . "' >$title</a>";
-
- $html = apply_filters('audio_send_to_editor_url', $html, $href, $title);
-
- return media_send_to_editor($html);
- }
-
- if ( !empty($_POST) ) {
- $return = media_upload_form_handler();
-
- if ( is_string($return) )
- return $return;
- if ( is_array($return) )
- $errors = $return;
- }
-
- if ( isset($_POST['save']) ) {
- $errors['upload_notice'] = __('Saved.');
- return media_upload_gallery();
- }
-
- if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' )
- return wp_iframe( 'media_upload_type_url_form', 'audio', $errors, $id );
-
- return wp_iframe( 'media_upload_type_form', 'audio', $errors, $id );
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since 2.5.0
- *
- * @return unknown
- */
-function media_upload_video() {
- $errors = array();
- $id = 0;
-
- if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
- // Upload File button was clicked
- $id = media_handle_upload('async-upload', $_REQUEST['post_id']);
- unset($_FILES);
- if ( is_wp_error($id) ) {
- $errors['upload_error'] = $id;
- $id = false;
- }
- }
-
- if ( !empty($_POST['insertonlybutton']) ) {
- $href = $_POST['insertonly']['href'];
- if ( !empty($href) && !strpos($href, '://') )
- $href = "http://$href";
-
- $title = esc_attr($_POST['insertonly']['title']);
- if ( empty($title) )
- $title = esc_attr( basename($href) );
-
- if ( !empty($title) && !empty($href) )
- $html = "<a href='" . esc_url($href) . "' >$title</a>";
-
- $html = apply_filters('video_send_to_editor_url', $html, $href, $title);
-
- return media_send_to_editor($html);
- }
-
- if ( !empty($_POST) ) {
- $return = media_upload_form_handler();
-
- if ( is_string($return) )
- return $return;
- if ( is_array($return) )
- $errors = $return;
- }
-
- if ( isset($_POST['save']) ) {
- $errors['upload_notice'] = __('Saved.');
- return media_upload_gallery();
- }
-
- if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' )
- return wp_iframe( 'media_upload_type_url_form', 'video', $errors, $id );
-
- return wp_iframe( 'media_upload_type_form', 'video', $errors, $id );
-}
-
-/**
- * {@internal Missing Short Description}}
- *
- * @since 2.5.0
- *
- * @return unknown
- */
-function media_upload_file() {
- $errors = array();
- $id = 0;
-
- if ( isset($_POST['html-upload']) && !empty($_FILES) ) {
- check_admin_referer('media-form');
- // Upload File button was clicked
- $id = media_handle_upload('async-upload', $_REQUEST['post_id']);
- unset($_FILES);
- if ( is_wp_error($id) ) {
- $errors['upload_error'] = $id;
- $id = false;
- }
- }
-
- if ( !empty($_POST['insertonlybutton']) ) {
- $href = $_POST['insertonly']['href'];
- if ( !empty($href) && !strpos($href, '://') )
- $href = "http://$href";
-
- $title = esc_attr($_POST['insertonly']['title']);
- if ( empty($title) )
- $title = basename($href);
- if ( !empty($title) && !empty($href) )
- $html = "<a href='" . esc_url($href) . "' >$title</a>";
- $html = apply_filters('file_send_to_editor_url', $html, esc_url_raw($href), $title);
- return media_send_to_editor($html);
- }
-
- if ( !empty($_POST) ) {
- $return = media_upload_form_handler();
-
- if ( is_string($return) )
- return $return;
- if ( is_array($return) )
- $errors = $return;
- }
-
- if ( isset($_POST['save']) ) {
- $errors['upload_notice'] = __('Saved.');
- return media_upload_gallery();
- }
-
- if ( isset($_GET['tab']) && $_GET['tab'] == 'type_url' )
- return wp_iframe( 'media_upload_type_url_form', 'file', $errors, $id );
-
- return wp_iframe( 'media_upload_type_form', 'file', $errors, $id );
-}
-