apply_filters( 'media_upload_default_type', string $type )
- Since
- 2.5.0
Filters the default media upload type in the legacy (pre-3.5.0) media popup.
Compatibility
- WordPress
- since 2.5.0
- 6.7.7
- 6.8.8
- 6.9.7
- 7.0.4
- 7.1.0
Present in every tracked release (6.7.7 to 7.1.0).
Parameters
$typestring- The default media upload type. Possible values include 'image', 'audio', 'video', 'file', etc. Default 'file'.
Where this hook fires · 1
wp-admin/media-upload.php:64file scope
Source code
* * @since 2.5.0 * * @param string $type The default media upload type. Possible values include * 'image', 'audio', 'video', 'file', etc. Default 'file'. */ $type = apply_filters( 'media_upload_default_type', 'file' );} // Tab: gallery, library, or type-specific.if ( isset( $_GET['tab'] ) ) { $tab = (string) $_GET['tab'];} else {Changelog
Introduced in 2.5.0. Unchanged from 6.7.7 through 7.1.0.
Signature, return type and hooks compared across 5 parsed releases.
About this page
- Parsed data
- Generated from the wordpress-develop 6.7.7 tag, and regenerated for each WordPress release so it tracks the code rather than a snapshot of it.
- Corrections
- Something wrong on this page? Report it and it gets fixed in the next regeneration.