X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/3f5685912e89eb3b0534acd85aa0946b1ca2bbe3..refs/tags/wordpress-4.6.1:/wp-admin/includes/media.php diff --git a/wp-admin/includes/media.php b/wp-admin/includes/media.php index 1bfe3e27..c6b2dcd1 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); + /** + * Filters 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 "
- | " . __('File name:') . " $filename | -
" . __('File type:') . " $post->post_mime_type | |
" . __('Upload date:') . " " . mysql2date( get_option('date_format'), $post->post_date ) . " |
+
+ $image_edit_button + |
+
+ " . __('File name:') . " $filename +" . __('File type:') . " $post->post_mime_type +" . __('Upload date:') . " " . mysql2date( __( 'F j, Y' ), $post->post_date ). ' '; + if ( !empty( $media_dims ) ) + $item .= "" . __('Dimensions:') . " $media_dims \n"; - if ( !empty($media_dims) ) - $item .= " |
" . __('Dimensions:') . " $media_dims | |
$image_edit_button | |
" . sprintf( __( 'Required fields are marked %s' ), '*' ) . " | |
$send $thumbnail $delete | |
" . $r['send'] . " $thumbnail $delete | |
\n\t\t\t | "; - if ( !empty($field[$field['input']]) ) - $item .= $field[$field['input']]; + $item .= "\t\t |
---|---|
\n\t\t\t | ";
+ if ( !empty( $field[ $field['input'] ] ) )
+ $item .= $field[ $field['input'] ];
elseif ( $field['input'] == 'textarea' ) {
- $item .= "";
+ if ( 'post_content' == $id && user_can_richedit() ) {
+ // Sanitize_post() skips the post_content when user_can_richedit.
+ $field['value'] = htmlspecialchars( $field['value'], ENT_QUOTES );
+ }
+ // Post_excerpt is already escaped by sanitize_post() in get_attachment_fields_to_edit().
+ $item .= "';
} else {
- $item .= "";
+ $item .= "";
}
- if ( !empty($field['helps']) )
- $item .= " " . join( " \n", array_unique((array) $field['helps']) ) . ' '; + if ( !empty( $field['helps'] ) ) + $item .= "" . join( " \n", array_unique( (array) $field['helps'] ) ) . ' '; $item .= " | \n\t\t
$html | |
{$form_fields['_final']} |
" . join( "
\n", array_unique( (array) $field['helps'] ) ) . '
'; + $item .= "' . + sprintf( __( 'Required fields are marked %s' ), '*' ) . '
+' . sprintf( __('The web browser on your device cannot be used to upload files. You may be able to use the native app for your device instead.'), 'https://apps.wordpress.org/' ) . '
'; + return; + } - $flash = apply_filters('flash_uploader', $flash); + $upload_action_url = admin_url('async-upload.php'); $post_id = isset($_REQUEST['post_id']) ? intval($_REQUEST['post_id']) : 0; + $_type = isset($type) ? $type : ''; + $_tab = isset($tab) ? $tab : ''; + $max_upload_size = wp_max_upload_size(); + if ( ! $max_upload_size ) { + $max_upload_size = 0; + } ?> - -- +
+ - -