Skip to content

Commit 1a909d3

Browse files
committed
Fix AMP helper function test cases
1 parent ae566e5 commit 1a909d3

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

Diff for: tests/php/test-amp-helper-functions.php

+7-1
Original file line numberDiff line numberDiff line change
@@ -2128,7 +2128,13 @@ public function insert_site_icon_attachment( $file ) {
21282128

21292129
/** This filter is documented in wp-admin/includes/class-custom-image-header.php */
21302130
$cropped = apply_filters( 'wp_create_file_in_uploads', $cropped, $attachment_id ); // For replication.
2131-
$object = $wp_site_icon->create_attachment_object( $cropped, $attachment_id );
2131+
2132+
if ( function_exists( 'wp_copy_parent_attachment_properties' ) ) {
2133+
$object = wp_copy_parent_attachment_properties( $cropped, $attachment_id );
2134+
} else {
2135+
$object = $wp_site_icon->create_attachment_object( $cropped, $attachment_id );
2136+
}
2137+
21322138
unset( $object['ID'] );
21332139

21342140
// Update the attachment.

0 commit comments

Comments
 (0)