X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/542cf06a610bc430421351ace7a2cc45f393b990..3194d1bb103c2d8db4f44feeced5e58ee2756658:/wp-admin/includes/media.php?ds=sidebyside diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index e5c89e07..9990b9fd 100644 --- a/wp-admin/includes/media.php +++ b/wp-admin/includes/media.php @@ -7,11 +7,11 @@ */ /** - * {@internal Missing Short Description}} + * Defines the default media upload tabs * - * @since unknown + * @since 2.5.0 * - * @return unknown + * @return array default tabs */ function media_upload_tabs() { $_default_tabs = array( @@ -21,16 +21,25 @@ function media_upload_tabs() { 'library' => __('Media Library') ); - return apply_filters('media_upload_tabs', $_default_tabs); + /** + * Filter the available tabs in the legacy (pre-3.5.0) media popup. + * + * @since 2.5.0 + * + * @param array $_default_tabs An array of media tabs. + */ + return apply_filters( 'media_upload_tabs', $_default_tabs ); } /** - * {@internal Missing Short Description}} + * Adds the gallery tab back to the tabs array if post has image attachments * - * @since unknown + * @since 2.5.0 * - * @param unknown_type $tabs - * @return unknown + * @global wpdb $wpdb WordPress database abstraction object. + * + * @param array $tabs + * @return array $tabs with gallery if post has image attachment */ function update_gallery_tab($tabs) { global $wpdb; @@ -54,31 +63,37 @@ function update_gallery_tab($tabs) { return $tabs; } -add_filter('media_upload_tabs', 'update_gallery_tab'); /** - * {@internal Missing Short Description}} + * Outputs the legacy media upload tabs UI. + * + * @since 2.5.0 * - * @since unknown + * @global string $redir_tab */ function the_media_upload_tabs() { global $redir_tab; $tabs = media_upload_tabs(); + $default = 'type'; if ( !empty($tabs) ) { echo "