wp_media_upload_handler() – Handles the process of uploading media.

You appear to be a bot. Output may be restricted

Description

Handles the process of uploading media.

Usage

$null|string = wp_media_upload_handler();

Parameters

Returns

null|string

Source

File name: wordpress/wp-admin/includes/media.php
Lines:

101 to 122 of 122

    if ( is_string( $return ) ) {
      return $return;
    }

    if ( is_array( $return ) ) {
      $errors = $return;
    }
  }

  if ( isset( $_GET['tab'] ) && 'type_url' === $_GET['tab'] ) {
    $type = 'image';

    if ( isset( $_GET['type'] ) && in_array( $_GET['type'], array( 'video', 'audio', 'file' ), true ) ) {
      $type = $_GET['type'];
    }

    return wp_iframe( 'media_upload_type_url_form', $type, $errors, $id );
  }

  return wp_iframe( 'media_upload_type_form', 'image', $errors, $id );
}
 

 View on GitHub View on Trac