Hooks and Filters for Developers

Add the examples below to a child theme or to a small custom plugin. Do not edit the files of the gallery plugin itself, because an update would remove your change.

add_filter( 'techbella_show_featured_image_in_gallery', '__return_false', 20 );

Do not load the slider script of the plugin

Use this when your theme already loads the same slider library.

add_filter( 'techbella_enqueue_slick_js', '__return_false' );
add_filter( 'techbella_wrapper_add_classes', function ( $classes, $attachment_ids ) {
	return $classes . ' my-gallery-class';
}, 20, 2 );

Change image sizes

add_filter( 'techbella_new_thumb_img_size', function () { return 'my_thumb_size'; }, 20 );
add_filter( 'techbella_new_main_img_size', function () { return 'large'; }, 20 );
add_filter( 'techbella_gallery_slider_lightbox_image_size', function () { return 'large'; }, 20 );
add_filter( 'techbella_gallery_slider_zoom_image_size', function () { return 'full'; }, 20 );

Register a custom size with add_image_size() first. The thumbnail filter is useful when a theme sets a very large size for the WooCommerce gallery thumbnail.

Other filters and actions

  • techbella_load_entrie_site loads the gallery files on every page, for example for quick view.
  • techbella_default_gallery_hook returns false to stop the plugin from replacing the gallery.
  • techbella_clear_variation_cache changes how long variation galleries are cached, in seconds.
  • techbella_add_img_class adds a class to gallery images.
  • techbella_lazyload_src changes the placeholder image used before lazy loading.
  • techbella_carousel_mode returns false to turn the extra slides off.
  • techbella_product_id changes the product the gallery files are prepared for.
  • techbella_before_image_gallery and techbella_after_image_gallery are actions that run around the gallery.

After you load product HTML with AJAX, for example in a quick view, start every gallery on the page again.

window.techbella_product_gallery_slider_int();

Need more help?

Cannot find what you are looking for?

Tell us about your question or your project. If we can help, we get in touch.

Get Started