Enable Media Replace 4.2.3 has 15 actions and 31 filters, read directly from its source code on Nov 17, 2026. The list updates automatically when a new version is released.
How to use these hooks
Actions let you run your own code at a specific moment. Filters let you change a value before the plugin uses it. Put your code in a child theme's functions.php or a code-snippets plugin, never in the plugin's own files, because updates overwrite them.
// Run your own code when Enable Media Replace fires an action
add_action( 'breeze_clear_all_cache', function() {
// Your code runs here.
}, 10, 1 );
// Change a value Enable Media Replace is about to use
add_filter( 'emr/replace/default_type', function( $value, $attachment_id ) {
// Change $value here.
return $value;
}, 10, 2 );Parts of a name in {braces} are filled in at runtime (for example a post type or field ID). Choose Example on any hook for a ready-to-edit snippet.
All hooks
-
emr/replace/default_type
filter/** * Filters the default replace_type ('replace' or 'replace_and_search') shown * on the media replace screen. Overrides whatever was last remembered in the * stored option. */ apply_filters( 'emr/replace/default_type', $this->view->settings['replace_type'], $attachment_id ); -
apply_filters( 'emr_unfiltered_get_attached_file', true ); -
emr/file/basedir_check
filterapply_filters( 'emr/file/basedir_check', $restricted ); -
apply_filters( 'emr/externals/elementor_is_active', $bool ); -
apply_filters( 'emr/externals/urlencode_is_active', $bool ); -
emr/replace/file_is_movable
filterapply_filters( 'emr/replace/file_is_movable', true, $attachment_id ); -
apply_filters( 'emr/replace/original_image_path', $source_file, $this->post_id ); -
emr/upsell
filterapply_filters( 'emr/upsell', current_user_can('install_plugins') ); -
breeze_clear_all_cache
actiondo_action( 'breeze_clear_all_cache' ); -
do_action( 'cache_enabler_clear_complete_cache' ); -
emr_after_remove_current
actiondo_action( 'emr_after_remove_current', $this->post_id, $meta, $backup_sizes, $this->sourceFile, $this->targetFile ); -
do_action( 'emr_after_replace_type_options' ); -
do_action( 'emr_after_search_type_options' ); -
do_action( 'emr_before_replace_type_options' ); -
apply_filters( 'emr_display_replace_type_options', true ); -
apply_filters( 'emr_enable_replace_and_search', true ); -
emr_returnurl
filterapply_filters( 'emr_returnurl', $url ); -
emr_returnurl_failed
filterapply_filters( 'emr_returnurl_failed', $url ); -
emr_unique_filename
filterapply_filters( 'emr_unique_filename', $unique, $path, $this->post_id ); -
emr/cache/flush
actiondo_action( 'emr/cache/flush', $post_id ); -
do_action( 'emr/converter/prevent-offload', $this->post_id ); -
do_action( 'emr/converter/prevent-offload-off', $this->post_id ); -
emr/feature/background
filterapply_filters( 'emr/feature/background', true ); -
emr/feature/remote_notice
filterapply_filters( 'emr/feature/remote_notice', true ); -
emr/file/exists
filterapply_filters( 'emr/file/exists', $this->exists, $this->fullpath, $this ); -
emr/file/virtual/translate
filterapply_filters( 'emr/file/virtual/translate', $sourceFileObj->getFullPath(), $sourceFileObj, $this->post_id ); -
emr/filesystem/abspath
filterapply_filters( 'emr/filesystem/abspath', $abspath ); -
emr/filesystem/addfile
actiondo_action( 'emr/filesystem/addfile', array($destinationPath, $destination, $this, $is_new) ); -
apply_filters( 'emr/filesystem/processFilePath', $path, $original_path ); -
emr/image/urltopath
filterapply_filters( 'emr/image/urltopath', false, $url, $this->getRawFullPath() ); -
emr/replace/doreplace
filterapply_filters( 'emr/replace/doreplace', true ); -
emr/replacer/content
filterapply_filters( 'emr/replacer/content', $content, $search, $replace ); -
apply_filters( 'emr/replacer/custom_replace_query', array(), $base_url, $search_urls, $replace_urls ); -
emr/replacer/load_meta_value
filterapply_filters( 'emr/replacer/load_meta_value', $content, $row, $component ); -
emr/replacer/replace_urls
actiondo_action( 'emr/replacer/replace_urls', $search_urls, $replace_urls, $base_url ); -
apply_filters( 'emr/replacer/replacement_tables', $table_options ); -
emr/replacer/save_meta_value
filterapply_filters( 'emr/replacer/save_meta_value', $content, $row, $component ); -
emr/success/timeout
filterapply_filters( 'emr/success/timeout', 5 ); -
enable_media_replace_title
filterapply_filters( 'enable_media_replace_title', $title ); -
do_action( 'enable-media-replace-upload-done', $target_url, $source_url, $this->post_id ); -
fastpixel/purge/all
actiondo_action( 'fastpixel/purge/all' ); -
litespeed_purge_all
actiondo_action( 'litespeed_purge_all' ); -
shortpixel_image_exists
filterapply_filters( 'shortpixel_image_exists', $this->exists, $this->fullpath, $this ); -
wp_handle_replace
actiondo_action( 'wp_handle_replace', array('post_id' => $this->post_id) ); -
wp_handle_upload
filterapply_filters( 'wp_handle_upload', array( 'file' => $this->targetFile->getFullPath(), 'url' => $this->getTargetURL(), 'type' => $this->targetFile->getMime(), ), 'sideload' ); -
wp_handle_upload_prefilter
filterapply_filters( 'wp_handle_upload_prefilter', $uploadFileArray );
Generated from Enable Media Replace's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Can't find the right hook?
We can build the customisation for you. Describe what you need: