X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/177fd6fefd2e3d5a0ea6591c71d660cabdb3c1a4..245e789b234afa4525862e7a6e5e3c2e7a52ef20:/wp-admin/media-upload.php diff --git a/wp-admin/media-upload.php b/wp-admin/media-upload.php index e7561669..9a6e8f90 100644 --- a/wp-admin/media-upload.php +++ b/wp-admin/media-upload.php @@ -1,41 +1,100 @@ + // let the action code decide how to handle the request + if ( $tab == 'type' || $tab == 'type_url' || ! array_key_exists( $tab , media_upload_tabs() ) ) { + /** + * Fires inside specific upload-type views in the legacy (pre-3.5.0) + * 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. + * + * 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 'media_upload_tabs' filter. + * + * @since 2.5.0 + */ + do_action( "media_upload_$type" ); + } else { + /** + * Fires inside limited and specific upload-tab views in the legacy + * (pre-3.5.0) media popup. + * + * The dynamic portion of the hook name, $tab, refers to the specific + * media upload tab. Possible values include 'library' (Media Library), + * or any custom tab registered via the 'media_upload_tabs' filter. + * + * @since 2.5.0 + */ + do_action( "media_upload_$tab" ); + }