Skip to content

jeremybasolo/404-Image-Interceptor-for-WordPress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

404 Image Interceptor for WordPress

This is a mu-plugin to intercept uploads images that return a 404 in a local development environment, fetching the image in php from the live site.

It is ONLY meant to be used in a local environment, if you do not want to copy locally all the images uploaded on a live WordPress website.

To use, simply copy the 404-image-interceptor.php file in your mu-plugins folder.

In the case of a single site WordPress installation, add the below to your wp-config.php, replacing the values with your own :

define('INTERCEPTOR_PATH', '/wp-content/uploads');
define('INTERCEPTOR_DOMAIN', 'https://domain.com');

In the case of a multi site WordPress installation, use that instead :

define('INTERCEPTOR_PATH', '/wp-content/uploads');
define('INTERCEPTOR_DOMAINS', array(
    'http://site1.dev' => 'https://domain1.com', 
    'http://site2.dev' => 'https://domain2.com', 
    'http://site3.dev' => 'https://domain3.com', 
);

About

A little mu-plugin allowing to fetch uploads images from another domain, in the context of local development

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages