media_upload_library() WordPress Function
The media_upload_library() function allows you to upload and insert media files into your WordPress posts and pages. This function is located in the wp-admin/includes/media.php file.
media_upload_library() #
Retrieves the legacy media library form in an iframe.
Return
(string|null)
Source
File: wp-admin/includes/media.php
function media_upload_library() {
$errors = array();
if ( ! empty( $_POST ) ) {
$return = media_upload_form_handler();
if ( is_string( $return ) ) {
return $return;
}
if ( is_array( $return ) ) {
$errors = $return;
}
}
return wp_iframe( 'media_upload_library_form', $errors );
}
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
| Version | Description |
|---|---|
| 2.5.0 | Introduced. |