Skip to content

Commit

Permalink
Fix AMP helper function test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
thelovekesh committed Mar 14, 2024
1 parent ae566e5 commit 1a909d3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/php/test-amp-helper-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2128,7 +2128,13 @@ public function insert_site_icon_attachment( $file ) {

/** This filter is documented in wp-admin/includes/class-custom-image-header.php */
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
$object = $wp_site_icon->create_attachment_object( $cropped, $attachment_id );

if ( function_exists( 'wp_copy_parent_attachment_properties' ) ) {
$object = wp_copy_parent_attachment_properties( $cropped, $attachment_id );
} else {
$object = $wp_site_icon->create_attachment_object( $cropped, $attachment_id );
}

unset( $object['ID'] );

// Update the attachment.
Expand Down

0 comments on commit 1a909d3

Please sign in to comment.