Update WordPress to 5.2
This commit is contained in:
parent
489b5a5914
commit
e00f87f2f5
599 changed files with 119573 additions and 55990 deletions
|
|
@ -127,7 +127,7 @@ class Custom_Image_Header {
|
|||
get_current_screen()->set_help_sidebar(
|
||||
'<p><strong>' . __( 'For more information:' ) . '</strong></p>' .
|
||||
'<p>' . __( '<a href="https://codex.wordpress.org/Appearance_Header_Screen">Documentation on Custom Header</a>' ) . '</p>' .
|
||||
'<p>' . __( '<a href="https://wordpress.org/support/">Support Forums</a>' ) . '</p>'
|
||||
'<p>' . __( '<a href="https://wordpress.org/support/">Support</a>' ) . '</p>'
|
||||
);
|
||||
}
|
||||
|
||||
|
|
@ -820,7 +820,7 @@ endif;
|
|||
return $this->finished();
|
||||
} elseif ( $width > $max_width ) {
|
||||
$oitar = $width / $max_width;
|
||||
$image = wp_crop_image( $attachment_id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace( basename( $file ), 'midsize-' . basename( $file ), $file ) );
|
||||
$image = wp_crop_image( $attachment_id, 0, 0, $width, $height, $max_width, $height / $oitar, false, str_replace( wp_basename( $file ), 'midsize-' . wp_basename( $file ), $file ) );
|
||||
if ( ! $image || is_wp_error( $image ) ) {
|
||||
wp_die( __( 'Image could not be processed. Please go back and try again.' ), __( 'Image Processing Error' ) );
|
||||
}
|
||||
|
|
@ -828,7 +828,7 @@ endif;
|
|||
/** This filter is documented in wp-admin/custom-header.php */
|
||||
$image = apply_filters( 'wp_create_file_in_uploads', $image, $attachment_id ); // For replication
|
||||
|
||||
$url = str_replace( basename( $url ), basename( $image ), $url );
|
||||
$url = str_replace( wp_basename( $url ), wp_basename( $image ), $url );
|
||||
$width = $width / $oitar;
|
||||
$height = $height / $oitar;
|
||||
} else {
|
||||
|
|
@ -895,7 +895,7 @@ endif;
|
|||
$url = $file['url'];
|
||||
$type = $file['type'];
|
||||
$file = $file['file'];
|
||||
$filename = basename( $file );
|
||||
$filename = wp_basename( $file );
|
||||
|
||||
// Construct the object array
|
||||
$object = array(
|
||||
|
|
@ -984,7 +984,7 @@ endif;
|
|||
$this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
|
||||
|
||||
// Cleanup.
|
||||
$medium = str_replace( basename( $original ), 'midsize-' . basename( $original ), $original );
|
||||
$medium = str_replace( wp_basename( $original ), 'midsize-' . wp_basename( $original ), $original );
|
||||
if ( file_exists( $medium ) ) {
|
||||
wp_delete_file( $medium );
|
||||
}
|
||||
|
|
@ -1208,14 +1208,14 @@ endif;
|
|||
final public function create_attachment_object( $cropped, $parent_attachment_id ) {
|
||||
$parent = get_post( $parent_attachment_id );
|
||||
$parent_url = wp_get_attachment_url( $parent->ID );
|
||||
$url = str_replace( basename( $parent_url ), basename( $cropped ), $parent_url );
|
||||
$url = str_replace( wp_basename( $parent_url ), wp_basename( $cropped ), $parent_url );
|
||||
|
||||
$size = @getimagesize( $cropped );
|
||||
$image_type = ( $size ) ? $size['mime'] : 'image/jpeg';
|
||||
|
||||
$object = array(
|
||||
'ID' => $parent_attachment_id,
|
||||
'post_title' => basename( $cropped ),
|
||||
'post_title' => wp_basename( $cropped ),
|
||||
'post_mime_type' => $image_type,
|
||||
'guid' => $url,
|
||||
'context' => 'custom-header',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue