wp/wp-admin/media-upload.php
changeset 18 be944660c56a
parent 16 a86126ab1dd4
child 21 48c4eec2b7e6
--- a/wp/wp-admin/media-upload.php	Tue Dec 15 15:52:01 2020 +0100
+++ b/wp/wp-admin/media-upload.php	Wed Sep 21 18:19:35 2022 +0200
@@ -51,7 +51,7 @@
 
 // Upload type: image, video, file, ...?
 if ( isset( $_GET['type'] ) ) {
-	$type = strval( $_GET['type'] );
+	$type = (string) $_GET['type'];
 } else {
 	/**
 	 * Filters the default media upload type in the legacy (pre-3.5.0) media popup.
@@ -66,14 +66,14 @@
 
 // Tab: gallery, library, or type-specific.
 if ( isset( $_GET['tab'] ) ) {
-	$tab = strval( $_GET['tab'] );
+	$tab = (string) $_GET['tab'];
 } else {
 	/**
 	 * Filters the default tab in the legacy (pre-3.5.0) media popup.
 	 *
 	 * @since 2.5.0
 	 *
-	 * @param string $type The default media popup tab. Default 'type' (From Computer).
+	 * @param string $tab The default media popup tab. Default 'type' (From Computer).
 	 */
 	$tab = apply_filters( 'media_upload_default_tab', 'type' );
 }
@@ -87,13 +87,19 @@
 	 * media popup based on the current tab.
 	 *
 	 * The dynamic portion of the hook name, `$type`, refers to the specific
-	 * media upload type. Possible values include 'image', 'audio', 'video',
-	 * 'file', etc.
+	 * media upload type.
 	 *
 	 * The hook only fires if the current `$tab` is 'type' (From Computer),
 	 * 'type_url' (From URL), or, if the tab does not exist (i.e., has not
 	 * been registered via the {@see 'media_upload_tabs'} filter.
 	 *
+	 * Possible hook names include:
+	 *
+	 *  - `media_upload_audio`
+	 *  - `media_upload_file`
+	 *  - `media_upload_image`
+	 *  - `media_upload_video`
+	 *
 	 * @since 2.5.0
 	 */
 	do_action( "media_upload_{$type}" );