MetaSlider Gallery 2.39.0 has 14 actions and 25 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 MetaSlider Gallery fires an action
add_action( 'ml_gallery_add_menu_items', function() {
// Your code runs here.
}, 10, 1 );
// Change a value MetaSlider Gallery is about to use
add_filter( 'ml_gallery_caption_source_editable', function( $editable, $source ) {
// Change $editable here.
return $editable;
}, 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 whether a caption source is editable inline. */ apply_filters( 'ml_gallery_caption_source_editable', $editable, $source ); -
ml_gallery_data_attributes
filter/** * Filter the extra data-* attributes placed on the gallery container. */ apply_filters( 'ml_gallery_data_attributes', array(), $gallery_id, isset( $state['pro_settings'] ) ? (array) $state['pro_settings'] : null, $lg ); -
/** * Video mimes lightGallery embeds itself when handed the watch URL as the * slide src. Everything else is played from a file as HTML5 video. */ apply_filters( 'ml_gallery_embeddable_video_mimes', array( 'video/youtube', 'video/vimeo', 'video/wistia' ) ); -
ml_gallery_is_video_item
filter/** * Whether one attachment should count as a video. */ apply_filters( 'ml_gallery_is_video_item', $is_video, $id ); -
ml_gallery_item_player_url
filter/** * Filter the inline player URL for a gallery video item. */ apply_filters( 'ml_gallery_item_player_url', $url, $item, $settings ); -
ml_gallery_items
filter/** * Filter the resolved gallery items. */ apply_filters( 'ml_gallery_items', $items, $gallery_id, $context, $settings ); -
ml_gallery_layout_fields
action/** * Fires after the Layout picker, for options that belong to one layout. */ do_action( 'ml_gallery_layout_fields', $gallery_id, $lg_settings ); -
ml_gallery_layouts
filter/** * Filter the gallery layouts added by other plugins. */ apply_filters( 'ml_gallery_layouts', array() ); -
/** * Render Pro controls beside the caption preview. */ do_action( 'ml_gallery_pro_caption_controls', $gallery_id ); -
ml_gallery_pro_item_controls
action/** * Render Pro controls for one gallery item. */ do_action( 'ml_gallery_pro_item_controls', $editor_item, $post ? $post->ID : 0 ); -
ml_gallery_resolve_item
filter/** * Short-circuit classification for one attachment. */ apply_filters( 'ml_gallery_resolve_item', null, $id, $posters, $context ); -
ml_gallery_schema
filter/** * Filter the Schema.org graph emitted for galleries on this page. */ apply_filters( 'ml_gallery_schema', self::buildGraph() ); -
ml_gallery_schema_enabled
filter/** * Filter whether Schema.org markup is emitted for a gallery. */ apply_filters( 'ml_gallery_schema_enabled', $enabled, (int) $gallery_id ); -
ml_gallery_thumb_caption
action/** * Render extra markup inside a gallery thumbnail's caption overlay. */ do_action( 'ml_gallery_thumb_caption', $image_id, $gallery_id, $caption, $settings ); -
do_action( 'metaslider_lightbox_admin_notices' ); -
apply_filters( "{str_replace('.','_',$website_home)}_link", $proto . '://' . $url ); -
apply_filters( 'metaslider_lightbox_always_show_connect_report', false ); -
apply_filters( 'metaslider_lightbox_always_show_optin_notice', false ); -
apply_filters( 'metaslider_lightbox_connect_endpoint', 'https://connect.metaslider.com/wp-json/connect/v1/subscribe' ); -
apply_filters( 'metaslider_lightbox_connect_key', self::CONNECT_KEY ); -
apply_filters( 'metaslider_lightbox_load_assets', $should_load_assets, $options ); -
apply_filters( 'metaslider_lightbox_supported_plugins', $supported_plugins_list ); -
apply_filters( 'metaslider_skip_store_plugin_data', false ); -
ml_duplicate_gallery_pro
actiondo_action( 'ml_duplicate_gallery_pro', $gallery_id, $new_id ); -
ml_gallery_caption_sources
filterapply_filters( 'ml_gallery_caption_sources', array( 'manual' => __( 'Manual entry', 'ml-slider-lightbox' ), 'media_caption' => __( 'Media caption', 'ml-slider-lightbox' ), 'media_description' => __( 'Media description', 'ml-slider-lightbox' ), ) ); -
ml_gallery_import_root
filterapply_filters( 'ml_gallery_import_root', $base ); -
ml_gallery_preview_scripts
filterapply_filters( 'ml_gallery_preview_scripts', array(), $id ); -
ml_gallery_preview_settings
filterapply_filters( 'ml_gallery_preview_settings', array( 'enable_galleries' => true, 'enable_on_content' => false, 'page_excluded' => false, 'license_key' => '', 'view_image_label' => __( 'View image', 'ml-slider-lightbox' ), 'toolbar_strings' => array( 'backToStart' => __( 'Back to start', 'ml-slider-lightbox' ), 'jumpToSlide' => __( 'Jump to slide', 'ml-slider-lightbox' ), ), 'metaslider_options' => $metaslider_options, ), $id ); -
do_action( 'ml_gallery_pro_advanced_fields', $gallery_id ); -
do_action( 'ml_gallery_pro_appearance_fields', $gallery_id ); -
do_action( 'ml_gallery_pro_caption_fields', $gallery_id, $hide_lightbox_sections ); -
do_action( 'ml_gallery_pro_display_fields', $gallery_id ); -
do_action( 'ml_gallery_pro_gallery_fields', $gallery_id ); -
do_action( 'ml_gallery_pro_toolbar_fields', $gallery_id ); -
ml_gallery_video_placeholder
filterapply_filters( 'ml_gallery_video_placeholder', plugin_dir_url( __FILE__ ) . 'assets/images/video-placeholder.svg' ); -
ml_lightbox_settings
filterapply_filters( 'ml_lightbox_settings', $lightbox_settings ); -
ml_save_gallery_pro
actiondo_action( 'ml_save_gallery_pro', $gallery_id ); -
updraft_notices_force_id
filterapply_filters( 'updraft_notices_force_id', false, $this );
Generated from MetaSlider Gallery'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: