Make WordPress Core


Ignore:
Timestamp:
03/02/2024 08:13:02 PM (5 months ago)
Author:
joedolson
Message:

Media: Accessibility: Copy attachment properties on site icon crop.

Add parity between site icon, custom header, and default image crop behaviors. [53027] fixed a bug where alt text and caption were not copied on custom headers, but did not apply that change in any other context.

Deprecate the create_attachment_object method in the Wp_Site_Icon and Custom_Image_Header classes and replace that functionality with the new function wp_copy_parent_attachment_properties() to improve consistency.

Props afercia, rcreators, jorbin, joedolson, huzaifaalmesbah, shailu25, swissspidy, mukesh27.
Fixes #60524.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-admin/includes/class-wp-site-icon.php

    r55678 r57755  
    7979     *
    8080     * @since 4.3.0
     81     * @deprecated 6.5.0
    8182     *
    8283     * @param string $cropped              Cropped image URL.
     
    8586     */
    8687    public function create_attachment_object( $cropped, $parent_attachment_id ) {
     88        _deprecated_function( __METHOD__, '6.5.0', 'wp_copy_parent_attachment_properties()' );
     89
    8790        $parent     = get_post( $parent_attachment_id );
    8891        $parent_url = wp_get_attachment_url( $parent->ID );
Note: See TracChangeset for help on using the changeset viewer.