Advanced Media Offloader 4.7.3 has 18 actions and 35 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 Advanced Media Offloader fires an action
add_action( 'advmo_after_delete_local_file', function( $attachment_id, $deleteLocalRule ) {
// Your code runs here.
}, 10, 2 );
// Change a value Advanced Media Offloader is about to use
add_filter( 'advmo_local_deletion_rule', function( $requestedDeleteLocalRule, $attachment_id ) {
// Change $requestedDeleteLocalRule here.
return $requestedDeleteLocalRule;
}, 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
-
/** * Filter the local file deletion rule before applying it. */ apply_filters( 'advmo_local_deletion_rule', $requestedDeleteLocalRule, $attachment_id ); -
/** * Filter to determine whether an attachment should be offloaded. */ apply_filters( 'advmo_should_offload_attachment', true, $attachment_id ); -
/** * Delete optimizer sidecars only after their cloud upload and the * standard-file cleanup both succeeded. */ apply_filters( 'advmo_delete_image_operation_sidecars', true, $attachment_id, $rule, $metadata ); -
/** * Filter whether the current request is regenerating this attachment. * Third-party tools with custom call stacks can opt in here. */ apply_filters( 'advmo_is_thumbnail_regeneration_request', $detected, $attachment_id ); -
/** * Upload optimizer-generated sidecars for the metadata being committed. * Returning false prevents local cleanup and rolls the WordPress image * operation back to its previous metadata. */ apply_filters( 'advmo_upload_image_operation_sidecars', true, $attachment_id, $subdir, $metadata, $operation ); -
/** * Filters the post arguments used during an async request. */ apply_filters( "{$this->identifier}_post_args", $args ); -
/** * Filters the post arguments used during an async request. */ apply_filters( "{$this->identifier}_query_args", $args ); -
/** * Filters the post arguments used during an async request. */ apply_filters( "{$this->identifier}_query_url", $url ); -
/** * Number of seconds to sleep between batches. Defaults to 0 seconds, minimum * 0. */ apply_filters( "{$this->identifier}_seconds_between_batches", apply_filters( $this->prefix . '_seconds_between_batches', 0 ) ); -
/** * Should wp_die be used? */ apply_filters( "{$this->identifier}_wp_die", true ); -
/** * Number of seconds to sleep between batches. Defaults to 0 seconds, minimum * 0. */ apply_filters( "{$this->prefix}_seconds_between_batches", 0 ); -
/** * Fires after the local file(s) associated with an attachment have been * deleted. */ do_action( 'advmo_after_delete_local_file', $attachment_id, $deleteLocalRule ); -
/** * Fires after the attachment has been uploaded, its offload metadata is * committed, and any immediate local cleanup has been attempted. This action * may fire again while an interrupted cleanup is resumed. */ do_action( 'advmo_after_upload_to_cloud', $attachment_id ); -
/** * Filter the list of S3 object keys to delete for an attachment. */ apply_filters( 'advmo_attachment_delete_keys', $keys, $attachment_id, $base_dir ); -
/** * Fires before the local file(s) associated with an attachment are deleted. */ do_action( 'advmo_before_delete_local_file', $attachment_id, $deleteLocalRule ); -
/** * Fires before the attachment is uploaded to the cloud. */ do_action( 'advmo_before_upload_to_cloud', $attachment_id ); -
/** * Filters the list of available cloud providers. */ apply_filters( 'advmo_cloud_providers', $this->providers ); -
/** * Fires after WordPress committed an edited/restored metadata set. Optimizer * integrations may finish a synchronous pre-commit run here. */ do_action( 'advmo_image_operation_committed', $attachment_id, $pendingCleanup ); -
/** * Filter the integration that temporarily owns local cleanup. */ apply_filters( 'advmo_local_cleanup_deferred_by', null, $deleteLocalRule, $attachment_id, $context ); -
/** * Fires after WordPress committed regenerated attachment metadata. Optimizer * integrations may finish deferred processing here. */ do_action( 'advmo_regeneration_committed', $attachment_id, $pendingCleanup ); -
/** * Filter exact obsolete cloud keys after thumbnail regeneration. Optimizer * integrations append sidecars for removed standard files. */ apply_filters( 'advmo_regeneration_obsolete_cloud_keys', $obsolete_keys, $attachment_id, $subdir, $old_metadata, $new_metadata ); -
/** * Fires after standard files have been re-uploaded during a reoffload. */ do_action( 'advmo_reoffload_attachment', $attachment_id, $advmo_path ); -
/** * Filter to determine whether the original image should be uploaded to the * cloud. */ apply_filters( 'advmo_should_upload_original_image', true, $attachment_id, $metadata ); -
/** * Filters the MIME types that get a local copy of a cloud-only file. */ apply_filters( 'advmo_temp_fetch_mime_types', ['image/svg+xml'], $attachmentId ); -
apply_filters( 'advmo_show_donate_links', true ); -
apply_filters( "{$this->identifier}_queue_lock_time", $lock_duration ); -
do_action( "{$this->identifier}_cancelled" ); -
do_action( "{$this->identifier}_completed" ); -
apply_filters( "{$this->identifier}_default_time_limit", 20 ); -
apply_filters( "{$this->identifier}_memory_exceeded", $return ); -
do_action( "{$this->identifier}_paused" ); -
do_action( "{$this->identifier}_resumed" ); -
apply_filters( "{$this->identifier}_time_exceeded", $return ); -
do_action( 'advmo_after_delete_regenerated_local_thumbnails', $attachment_id, $thumbnails, $rule ); -
apply_filters( 'advmo_aws_domain', $domain ); -
apply_filters( 'advmo_backblaze_b2_domain', $domain ); -
do_action( 'advmo_before_delete_regenerated_local_thumbnails', $attachment_id, $thumbnails, $rule ); -
apply_filters( 'advmo_cloudflare_r2_domain', $domain ); -
do_action( 'advmo_deferred_cleanup_expired', $attachment_id, $pendingCleanup ); -
apply_filters( 'advmo_deferred_cleanup_max_age', self::DEFERRED_CLEANUP_MAX_AGE, $pendingCleanup ); -
apply_filters( 'advmo_delete_obsolete_regenerated_cloud_files', !$this->shouldPreserveObsoleteCloudFiles(), $attachment_id, $metadata, $old_metadata ); -
apply_filters( 'advmo_dos_domain', $domain ); -
do_action( 'advmo_loaded', $this ); -
apply_filters( 'advmo_minio_domain', $domain ); -
apply_filters( 'advmo_object_acl', 'public-read', $file, $key ); -
do_action( 'advmo_register_providers', $this ); -
apply_filters( 'advmo_wasabi_domain', $domain ); -
do_action( 'deprecated_argument_run', $function, $message, $version ); -
do_action( 'deprecated_function_run', $function, $replacement, $version ); -
apply_filters( 'deprecated_function_trigger_error', true ); -
apply_filters( 'ewww_image_optimizer_bypass', false, $file_path ); -
apply_filters( 'https_local_ssl_verify', false ); -
apply_filters( 'image_editor_output_format', [], $expectedFile, $sourceMime );
Generated from Advanced Media Offloader's GPL-licensed source code. Hooks inside bundled third-party libraries are not listed.
Done for you
Rather have it built for you?
Tell us what should change and we’ll write and test the code using these hooks.
Custom hook snippet
from $49
A small, update-safe change built on the plugin’s own hooks.
- Code written against the plugin’s actions and filters
- Tested on a staging copy of your site
- Install instructions included
Typical turnaround: 2–3 business days
Choose thisPlugin customisation
from $149
New features or changed behaviour, without editing the plugin’s files.
- Built as a companion plugin, so updates never wipe it
- Exact quote before we start
- Tested on staging, then deployed
Typical turnaround: 3–7 business days
Choose thisNot sure which fits? Describe what you need and we’ll suggest the simplest option.
Can't find the right hook?
We can build the customisation for you. Describe what you need: