Filters and events
| Filter | Use |
|---|---|
vlt_grid_query_args | WP_Query arguments of a grid. |
vlt_grid_item_html | HTML of one item. |
vlt_grid_config | A layout’s settings after they are read. |
vlt_grid_css_classes | Classes listed in the Custom CSS help (Pro). |
vlt_grid_empty_message | The “No items found” text. |
vlt_grid_breakpoints | Tablet and mobile widths. |
vlt_grid_image_size | Image size of a layout. |
vlt_grid_sources | Content sources of the editor. |
vlt_grid_template, vlt_grid_template_vars | Which template file is used, and its variables. |
vlt_grid_filter_terms_args | Terms shown in the filter. |
vlt_grid_lightbox_enabled | Turn the lightbox on or off in code. |
vlt_grid_insert_shortcodes | Shortcodes offered in the Inserts list (Pro). |
JavaScript events
Events fire on the grid and bubble, so you can listen on document. Re-run sliders, lightboxes or lazy loaders on vlt-grid:updated.
| Event | When |
|---|---|
vlt-grid:init | The grid is ready (also for grids added later with vltGridBuilder.init()). |
vlt-grid:before-load | A filter, page or Load More request starts. Cancelable: event.preventDefault() stops it. |
vlt-grid:updated | New items are in the page (event.detail.items). |
vlt-grid:filtered, vlt-grid:searched, vlt-grid:paginated | After updated, by what changed. |
vlt-grid:error | The request failed. |
document.addEventListener( 'vlt-grid:updated', ( event ) => {
myLightbox( event.detail.items );
} );
// Grids inserted later (a modal, a tab)
vltGridBuilder.init( container );
Was this article helpful?
Thanks for your feedback!