Ultimate Before After Image Slider & Gallery 4.7.22 has 2 actions and 17 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 Ultimate Before After Image Slider & Gallery fires an action
add_action( 'bafg_after_slider', function( $id ) {
// Your code runs here.
}, 10, 1 );
// Change a value Ultimate Before After Image Slider & Gallery is about to use
add_filter( 'bafg_admin_column_image_url', function( $image_url, $column_name, $meta, $id, $method ) {
// Change $image_url here.
return $image_url;
}, 10, 5 );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
-
bafg_admin_column_image_url
filter/** * Allow Pro/extensions to modify the admin column image URL. */ apply_filters( 'bafg_admin_column_image_url', $image_url, $column_name, $meta, $id, $method ); -
bafg_{$key}_sections
filterapply_filters( "bafg_{$key}_sections", $params['sections'] ); -
bafg_{$key}_title
filterapply_filters( "bafg_{$key}_title", $params['title'] ); -
bafg_{$key}_icon
filterapply_filters( "bafg_{$key}_icon", $params['icon'] ); -
bafg_{$key}_position
filterapply_filters( "bafg_{$key}_position", $params['position'] ); -
bafg_after_slider
actiondo_action( 'bafg_after_slider', $id ); -
bafg_before_after_style
filterapply_filters( 'bafg_before_after_style', array( 'id' => 'bafg_before_after_style', 'type' => 'imageselect', 'label' => __( 'BEAF template style', 'beaf-before-and-after-gallery' ), 'subtitle' => __( 'Select a style for the before and after label.', 'beaf-before-and-after-gallery' ), 'options' => array( 'default' => array( 'title' => __( 'Default', 'beaf-before-and-after-gallery' ), 'url' => BEAF_ASSETS_URL . 'image/default.png', ), ),... ); -
bafg_before_slider
actiondo_action( 'bafg_before_slider', $id ); -
bafg_icon_list
filterapply_filters( 'bafg_icon_list', $icons ); -
bafg_on_scroll_slide
filterapply_filters( 'bafg_on_scroll_slide', array( 'id' => '', 'type' => 'switch', 'label' => __( 'On Scroll Slide', 'beaf-before-and-after-gallery' ), 'default' => false, 'subtitle' => __( 'The before and after image slider will slide on scroll automatically.', 'beaf-before-and-after-gallery' ), 'dependency' => array( 'bafg_auto_slide', '==', false ), 'field_width' => 50, ), $post ); -
bafg_post_type_supports
filterapply_filters( 'bafg_post_type_supports', array( 'title' ) ); -
beaf_before_after_method
filterapply_filters( 'beaf_before_after_method', array( 'id' => 'bafg_before_after_method', 'type' => 'radio', 'label' => __( 'Before After Method', 'beaf-before-and-after-gallery' ), 'title' => __( 'Before After Method', 'beaf-before-and-after-gallery' ), 'subtitle' => __( 'Choose a method to make a before after slider using 2 images', 'beaf-before-and-after-gallery' ), 'options' => array( 'method_1' => array( 'label' => __( 'Method 1 (Using... ); -
apply_filters( 'beaf_gallery_generator_template', $template ); -
beaf_option_field_state
filterapply_filters( 'beaf_option_field_state', array( 'class' => $class, 'badges' => $badges, ), $field, $value, $settings_id, $parent ); -
beaf_options_metabox_files
filterapply_filters( 'beaf_options_metabox_files', $metaboxes ); -
beaf_options_setting_files
filterapply_filters( 'beaf_options_setting_files', $options ); -
beaf_options_taxonomy_files
filterapply_filters( 'beaf_options_taxonomy_files', $taxonomies ); -
beaf_publicly_queryable
filterapply_filters( 'beaf_publicly_queryable', $bafg_publicly_queriable ); -
widget_title
filterapply_filters( 'widget_title', $instance['title'] );
Generated from Ultimate Before After Image Slider & 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: