Update WordPress to 5.2

This commit is contained in:
Oliver Davies 2019-05-08 08:05:39 +01:00
parent 489b5a5914
commit e00f87f2f5
599 changed files with 119573 additions and 55990 deletions

View file

@ -434,7 +434,7 @@ function media_handle_sideload( $file_array, $post_id, $desc = null, $post_data
$url = $file['url'];
$type = $file['type'];
$file = $file['file'];
$title = preg_replace( '/\.[^.]+$/', '', basename( $file ) );
$title = preg_replace( '/\.[^.]+$/', '', wp_basename( $file ) );
$content = '';
// Use image exif/iptc data for title and caption defaults if possible.
@ -826,7 +826,7 @@ function wp_media_upload_handler() {
if ( isset( $_POST['media_type'] ) && 'image' != $_POST['media_type'] ) {
$title = esc_html( wp_unslash( $_POST['title'] ) );
if ( empty( $title ) ) {
$title = esc_html( basename( $src ) );
$title = esc_html( wp_basename( $src ) );
}
if ( $title && $src ) {
@ -930,7 +930,7 @@ function media_sideload_image( $file, $post_id, $desc = null, $return = 'html' )
}
$file_array = array();
$file_array['name'] = basename( $matches[0] );
$file_array['name'] = wp_basename( $matches[0] );
// Download file to temp location.
$file_array['tmp_name'] = download_url( $file );
@ -2898,7 +2898,11 @@ function media_upload_max_image_resize() {
* @since 3.5.0
*/
function multisite_over_quota_message() {
echo '<p>' . sprintf( __( 'Sorry, you have used all of your storage quota of %s MB.' ), get_space_allowed() ) . '</p>';
echo '<p>' . sprintf(
/* translators: %s: allowed space allocation */
__( 'Sorry, you have used your space allocation of %s. Please delete some files to upload more files.' ),
size_format( get_space_allowed() * MB_IN_BYTES )
) . '</p>';
}
/**
@ -3008,19 +3012,33 @@ function edit_form_image_editor( $post ) {
?>
</div>
<div class="wp_attachment_details edit-form-section">
<?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?>
<p class="attachment-alt-text">
<label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />
<input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" aria-describedby="alt-text-description" value="<?php echo esc_attr( $alt_text ); ?>" />
</p>
<p class="attachment-alt-text-description" id="alt-text-description">
<?php
printf(
/* translators: 1: link start tag, 2: accessibility text, 3: link end tag */
__( '%1$sDescribe the purpose of the image%2$s%3$s. Leave empty if the image is purely decorative.' ),
'<a href="' . esc_url( 'https://www.w3.org/WAI/tutorials/images/decision-tree' ) . '" target="_blank" rel="noopener noreferrer">',
sprintf(
'<span class="screen-reader-text"> %s</span>',
/* translators: accessibility text */
__( '(opens in a new tab)' )
),
'</a>'
);
?>
</p>
<?php endif; ?>
<p>
<label for="attachment_caption"><strong><?php _e( 'Caption' ); ?></strong></label><br />
<textarea class="widefat" name="excerpt" id="attachment_caption"><?php echo $post->post_excerpt; ?></textarea>
</p>
<?php if ( 'image' === substr( $post->post_mime_type, 0, 5 ) ) : ?>
<p>
<label for="attachment_alt"><strong><?php _e( 'Alternative Text' ); ?></strong></label><br />
<input type="text" class="widefat" name="_wp_attachment_image_alt" id="attachment_alt" value="<?php echo esc_attr( $alt_text ); ?>" />
</p>
<?php endif; ?>
<?php
$quicktags_settings = array( 'buttons' => 'strong,em,link,block,del,ins,img,ul,ol,li,code,close' );
$editor_args = array(
@ -3033,11 +3051,11 @@ function edit_form_image_editor( $post ) {
?>
<label for="attachment_content"><strong><?php _e( 'Description' ); ?></strong>
<?php
if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
echo ': ' . __( 'Displayed on attachment pages.' );
}
?>
<?php
if ( preg_match( '#^(audio|video)/#', $post->post_mime_type ) ) {
echo ': ' . __( 'Displayed on attachment pages.' );
}
?>
</label>
<?php wp_editor( $post->post_content, 'attachment_content', $editor_args ); ?>