Automattic / newspack-custom-content-migrator

Custom migration tasks for launching and migrating Newspack sites on Atomic
5 stars 5 forks source link

Add and remove filter in wrapper for image urls #445

Closed naxoc closed 7 months ago

naxoc commented 7 months ago

This to avoid CDN urls in migrations

How to test

On a site that is connected to Jetpack, first run this to verify that you get a cdn url: wp eval "var_dump(wp_get_attachment_image_src( 71044, 'full'));"

Then test the new function that wraps: wp eval "var_dump(\NewspackCustomContentMigrator\Logic\Attachments::get_attachment_image_src( 71044, 'full'));" you should now not be getting a CDN url.

We can likely use this function from more places than the Block Generator where I wanted it fixed, but let's start with this.