Merged in feature/81-dev-dev01 (pull request #5)
auto-patch 81-dev-dev01-2023-12-05T22_45_26 * auto-patch 81-dev-dev01-2023-12-05T22_45_26
This commit is contained in:
@@ -509,30 +509,37 @@ class Custom_Image_Header {
|
||||
<div class="wrap">
|
||||
<h1><?php _e( 'Custom Header' ); ?></h1>
|
||||
|
||||
<?php if ( current_user_can( 'customize' ) ) { ?>
|
||||
<div class="notice notice-info hide-if-no-customize">
|
||||
<p>
|
||||
<?php
|
||||
printf(
|
||||
<?php
|
||||
if ( current_user_can( 'customize' ) ) {
|
||||
$message = sprintf(
|
||||
/* translators: %s: URL to header image configuration in Customizer. */
|
||||
__( 'You can now manage and live-preview Custom Header in the <a href="%s">Customizer</a>.' ),
|
||||
admin_url( 'customize.php?autofocus[control]=header_image' )
|
||||
);
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
wp_admin_notice(
|
||||
$message,
|
||||
array(
|
||||
'type' => 'info',
|
||||
'additional_classes' => array( 'hide-if-no-customize' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
<?php if ( ! empty( $this->updated ) ) { ?>
|
||||
<div id="message" class="updated">
|
||||
<p>
|
||||
<?php
|
||||
/* translators: %s: Home URL. */
|
||||
printf( __( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ), esc_url( home_url( '/' ) ) );
|
||||
?>
|
||||
</p>
|
||||
</div>
|
||||
<?php } ?>
|
||||
if ( ! empty( $this->updated ) ) {
|
||||
$updated_message = sprintf(
|
||||
/* translators: %s: Home URL. */
|
||||
__( 'Header updated. <a href="%s">Visit your site</a> to see how it looks.' ),
|
||||
esc_url( home_url( '/' ) )
|
||||
);
|
||||
wp_admin_notice(
|
||||
$updated_message,
|
||||
array(
|
||||
'id' => 'message',
|
||||
'additional_classes' => array( 'updated' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<h2><?php _e( 'Header Image' ); ?></h2>
|
||||
|
||||
@@ -875,14 +882,16 @@ endif;
|
||||
$this->set_header_image( compact( 'url', 'attachment_id', 'width', 'height' ) );
|
||||
|
||||
/**
|
||||
* Fires after the header image is set or an error is returned.
|
||||
* Filters the attachment file path after the custom header or background image is set.
|
||||
*
|
||||
* Used for file replication.
|
||||
*
|
||||
* @since 2.1.0
|
||||
*
|
||||
* @param string $file Path to the file.
|
||||
* @param int $attachment_id Attachment ID.
|
||||
*/
|
||||
do_action( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication.
|
||||
$file = apply_filters( 'wp_create_file_in_uploads', $file, $attachment_id ); // For replication.
|
||||
|
||||
return $this->finished();
|
||||
} elseif ( $width > $max_width ) {
|
||||
|
||||
Reference in New Issue
Block a user