You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Actually, this issue arises in the performance repo #339.
If we import unit test data from https://codex.wordpress.org/Theme_Unit_Test into any existing site, the actual image is different from the image tag class id wp-image-%image_ID.
For example, If we have an attachment id 10 for an image but when we import the unit test that image will get the last database insert id called 100. In this case, the image class still shows class="wp-image-10" instead of class="wp-image-100".
Actually, this issue arises in the performance repo #339.
If we import unit test data from https://codex.wordpress.org/Theme_Unit_Test into any existing site, the actual image is different from the image tag class id
wp-image-%image_ID
.For example, If we have an attachment id 10 for an image but when we import the unit test that image will get the last database insert id called 100. In this case, the image class still shows
class="wp-image-10"
instead ofclass="wp-image-100"
.WP Import changes the image URL in https://github.com/WordPress/wordpress-importer/blob/master/src/class-wp-import.php#L1269-L1280 function with an update query.
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->posts} SET post_content = REPLACE(post_content, %s, %s)", $from_url, $to_url ) );
It should be fixed so others can use the accurate image id from the class for newly imported attachments.
The text was updated successfully, but these errors were encountered: