Lens 1.0.4 has 2 actions and 33 filters, read directly from its source code on Nov 18, 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 Lens fires an action
add_action( 'lens/permissions/migrate', function() {
// Your code runs here.
}, 10, 1 );
// Change a value Lens is about to use
add_filter( 'lens_batch_size', function( $batch_size, $context, $server_config ) {
// Change $batch_size here.
return $batch_size;
}, 10, 3 );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 calculated batch size */ apply_filters( 'lens_batch_size', $batch_size, $context, $this->server_config ); -
/** * Filters the post types that display Lens bulk actions. */ apply_filters( 'lens_bulk_action_post_types', $this->bulk_action_post_types ); -
/** * Allow extensions to modify the localized configuration passed to JavaScript. */ apply_filters( 'lens/admin/localize_config', $localize_data ); -
/** * Filter the feature payload shared with JavaScript. */ apply_filters( 'lens/feature/client_config', $client_features ); -
/** * Filter feature meta before usage. */ apply_filters( 'lens/feature/definition', $feature, $slug ); -
/** * Filter the unlocked state for a feature. */ apply_filters( 'lens/feature/is_unlocked', $default_unlocked, $slug, $feature ); -
/** * Filter upgrade URL for specific feature. */ apply_filters( 'lens/feature/upgrade_url', $url, $slug, $feature ); -
/** * Filter how many presets stay unlocked on the free tier. */ apply_filters( 'lens/folder_colors/free_limit', self::$free_limit ); -
/** * Filter the base folder color presets. */ apply_filters( 'lens/folder_colors/presets', self::$presets ); -
/** * Allow premium code to disable folder access for specific users. */ apply_filters( 'lens/permissions/can_manage_folders', null, $user_id ); -
/** * Let premium code determine whether the capability is allowed. */ apply_filters( 'lens/permissions/capability', null, $capability, $user_id ); -
/** * Allow premium add-ons to run permission migrations. */ do_action( 'lens/permissions/migrate' ); -
/** * Allow third-parties (including the Pro add-on) to register additional REST * controllers. */ apply_filters( 'lens/rest/controllers', $controllers ); -
apply_filters( 'lens/feature/default_upgrade_url', 'https://lensforwp.com#pricing' ); -
apply_filters( 'lens/permissions/is_available', false, $current_user_id ); -
apply_filters( 'bulk_actions-upload', $bulk_actions ); -
do_action( 'lens_activate' ); -
apply_filters( 'lens_empty_trash_attachment_batch_size', 200 ); -
apply_filters( 'lens_empty_trash_media_ids_limit', 500 ); -
apply_filters( 'lens_post_custom_field_media_ids', $media_ids, $post_id ); -
apply_filters( 'lens/admin/auto_organize_template', '' ); -
apply_filters( 'lens/admin/extra_scripts', array() ); -
apply_filters( 'lens/admin/extra_styles', array() ); -
apply_filters( 'lens/admin/main_script_dependencies', $main_deps ); -
apply_filters( 'lens/favorites/free_limit', 1 ); -
apply_filters( 'lens/folder/resolve_color_update', array( 'handled' => false, ), $data['color'], array( 'folder_id' => $id, 'folder' => $folder, 'payload' => $data, ) ); -
apply_filters( 'lens/locks/pending_cleanup_state', array() ); -
apply_filters( 'lens/locks/permissions/can_access_locked_folder', false, $folder_id, $user_id ); -
apply_filters( 'lens/locks/permissions/can_lock_folder', false, $folder_id, $user_id ); -
apply_filters( 'lens/locks/permissions/can_unlock_folder', false, $folder_id, $user_id ); -
apply_filters( 'lens/locks/permissions/requires_lock_password', false, $folder_id, $operation ); -
apply_filters( 'lens/permissions/admin_can', true, $capability, $user_id ); -
apply_filters( 'lens/permissions/capabilities', self::$default_capabilities ); -
apply_filters( 'lens/permissions/user_permissions', null, $current_user_id ); -
apply_filters( 'media_row_actions', $actions, $post );
Generated from Lens'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: