WP Manifestindependent plugin directory
manifest / media / replace-files

HM Replace Files

Plugin which allows you to upload a replacement for an existing attachment.

★ 7stars
2.1kcomposer installs
1.0.0latest · 3 years ago

Install

Download source zip No release zip yet

This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.

Install straight from GitHub with WP-CLI:

wp plugin install https://github.com/humanmade/replace-files/archive/refs/heads/master.zip

On Packagist as humanmade/replace-files:

composer require humanmade/replace-files
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

This plugin allows you to upload a replacement for an existing attachment.

Cache Busting

Replacements use the same filename as the original, allowing existing links to continue working. However, this may require busting the cache to expose the new image. You can use the replace_files.merge_replacement.replaced action to handle this:

add_action( 'replace_files.merge_replacement.replaced', function ( $post_id ) {
    // Purge the server's cache.
    wp_remote_request( wp_get_attachment_url( $post_id ), [
        'method' => 'PURGE',
    ]);
});

Releases

1 release.

Tag
Published
1.0.0 latest
Oct 5, 2023 3 years ago

These releases are tags only. The author does not attach a packaged zip, so there are no download counts to report.