Size Shelf 1.0.1 has 6 actions and 15 filters, read directly from its source code on Nov 19, 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 Size Shelf fires an action
add_action( 'size_shelf_before_item', function( $arg1, $job ) {
// Your code runs here.
}, 10, 2 );
// Change a value Size Shelf is about to use
add_filter( 'image_size_names_choose', function( $defaults ) {
// Change $defaults here.
return $defaults;
}, 10, 1 );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
-
/** * This filter is documented in wp-admin/includes/media.php */ apply_filters( 'image_size_names_choose', $defaults ); -
/** * This filter is documented in wp-admin/includes/image.php */ apply_filters( 'intermediate_image_sizes_advanced', self::registered(), $image_meta, $attachment_id ); -
/** * Filters the boot data of the admin app. */ apply_filters( 'size_shelf_app_data', array( 'version' => SIZE_SHELF_VERSION, 'ids' => $ids, 'theme' => $theme->get( 'Name' ), 'uploadsUrl' => Size_Shelf_Files::baseurl(), 'mediaUrl' => admin_url( 'upload.php' ), 'editor' => self::editor_name(), 'multisite' => is_multisite(), 'maxTime' => (int) ini_get( 'max_execution_time' ), 'proUrl' => self::pro_url(), ) ); -
/** * Filters the dependencies of the admin app script (add-ons register their * scripts first). */ apply_filters( 'size_shelf_app_dependencies', $asset['dependencies'] ); -
/** * Whether an add-on runs "background" jobs (without the browser stepping * them). */ apply_filters( 'size_shelf_background_available', false ); -
/** * Fires before a job works on one item. */ do_action( 'size_shelf_before_item', (int) $item, $job ); -
/** * Fires before Size Shelf makes the sub-sizes of an image. */ do_action( 'size_shelf_before_regenerate', $attachment_id, array_keys( $targets ), $mode ); -
/** * Filters the capability needed to use Size Shelf. */ apply_filters( 'size_shelf_capability', 'manage_options' ); -
/** * Filters whether a size file counts as used somewhere (so cleanup keeps it). */ apply_filters( 'size_shelf_file_in_use', (bool) $in_meta, $name ); -
/** * Filters job arguments, so add-ons can accept extra scopes (e.g. a folder). */ apply_filters( 'size_shelf_job_args', $clean, $args, $type ); -
/** * Fires when a job completes. */ do_action( 'size_shelf_job_done', $job ); -
/** * Filters the attachment query of a regenerate or scan job (add-ons add scopes * here). */ apply_filters( 'size_shelf_job_query_args', $args, $job ); -
/** * Fires when a job starts. */ do_action( 'size_shelf_job_started', $job ); -
/** * Fires once Size Shelf has loaded. Add-ons hook in here. */ do_action( 'size_shelf_loaded' ); -
/** * Filters the attachment mime types Size Shelf regenerates. */ apply_filters( 'size_shelf_mime_types', $types ); -
/** * Filters the protected file names of an uploads folder. */ apply_filters( 'size_shelf_referenced_files', $refs, $dir ); -
/** * Fires after Size Shelf regenerated an image. */ do_action( 'size_shelf_regenerated', $attachment_id, $result, $meta ); -
/** * Filters the scopes a regenerate or scan job accepts. */ apply_filters( 'size_shelf_scopes', array( 'all', 'ids', 'dates' ) ); -
/** * Filters whether the Size Shelf screen shows the link to the Size Shelf Pro * add-on. */ apply_filters( 'size_shelf_show_pro_link', true ); -
/** * Filters the regex used to recognise generated size files of an image. */ apply_filters( 'size_shelf_size_file_pattern', '/^(?:' . implode( '|', array_unique( $bases ) ) . ')(?:-e\d{13})?-\d{1,5}x\d{1,5}(?:@2x)?\.(?:' . implode( '|', $exts ) . ')$/i', $attachment_id ); -
/** * Filters the detected source of an image size. */ apply_filters( 'size_shelf_size_source', $result, $name );
Generated from Size Shelf'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: