=== Webcasata Filter Gallery ===
Contributors:      webcasata
Tags:              gallery, image gallery, filterable gallery, filter, lightbox
Requires at least: 5.8
Tested up to:      6.9
Stable tag:        1.0.0
Requires PHP:      7.4
License:           GPL-2.0+
License URI:       https://www.gnu.org/licenses/gpl-2.0.html

Create beautiful filterable image galleries with dropdown filtering, lightbox, load more pagination, shortcode and Gutenberg block support.

== Description ==

**Webcasata Filter Gallery** lets you build stunning, responsive image galleries where visitors can instantly filter images using custom dropdown menus — all without any page reload.

= Key Features =

* **Multi-group dropdown filtering** — Create filter groups (e.g. "Country", "Room Type"). Each becomes a styled dropdown on the front end.
* **AND logic across groups, OR within a group** — Country=India AND Room=Kitchen; image can belong to multiple countries.
* **Custom styled dropdowns** — Single-select, closes on pick, with active pill indicators.
* **Real-time title search** — Search box with 220ms debounce filters images as you type.
* **Equal Grid & Masonry layouts** — Choose your preferred display style.
* **Configurable columns** — 1 to 6 columns with automatic responsive breakpoints.
* **Slide / Fade / None animations** — Smooth transitions when switching filters.
* **Load More pagination** — Shows a configurable number of images on load; load more on click. Set to -1 to show all.
* **Built-in Lightbox** — Full-screen image viewer with prev/next, keyboard support, and optional Visit Link button.
* **Image URL link** — Assign an external URL to any image, with optional new tab.
* **Image Title & Caption** — Display below each image. Title hideable via shortcode.
* **Filter labels on image cards** — Show assigned filter values as badge labels or ribbons.
* **Template override system** — WooCommerce-style. Copy templates to your theme to customise layout completely.
* **Shortcode** — `[wbfg_gallery id="X"]` with full inline attribute overrides.
* **Gutenberg Block** — Live preview block with full sidebar controls.
* **Per-gallery custom CSS** — Fine-tune each gallery independently.
* **Global settings** — Control defaults for all galleries from one Settings page.
* **Accessibility** — ARIA roles, keyboard-navigable dropdowns, focus management.
* **Fully responsive** — Mobile-first CSS with sensible breakpoints.

= Template Override System =

Copy templates to your active theme to customise the output:

`your-theme/webcasata-filter-gallery/image-card.php`
`your-theme/webcasata-filter-gallery/gallery-template.php`

All image variables are available in `image-card.php`: `$image`, `$title`, `$caption`, `$link_url`, `$link_new_tab`, `$filters`, `$lightbox`, `$show_title`, `$index`, `$gallery_id`.

= Shortcode Parameters =

`[wbfg_gallery id="X" columns="3" show_all="yes" per_page="6" loadmore="6" layout="grid" lightbox="yes" animation="slide" title="show"]`

| Parameter   | Values                         | Default      |
|-------------|--------------------------------|--------------|
| id          | Gallery post ID                | *(required)* |
| columns     | 1–6                            | 3            |
| show_all    | yes / no                       | yes          |
| per_page    | number or -1                   | 6            |
| loadmore    | number                         | 6            |
| layout      | grid / masonry                 | grid         |
| lightbox    | yes / no                       | yes          |
| animation   | slide / fade / none            | slide        |
| title       | show / hide                    | show         |

The **Image Size** setting (Thumbnail / Medium / Full) is configured globally in Settings → Display Settings and applies to all galleries.

= Credits =

Developed by **Vishal Singh** at [Webcasata](https://webcasata.com).

== Installation ==

1. Upload the `webcasata-filter-gallery` folder to `/wp-content/plugins/`.
2. Activate the plugin through **Plugins › Installed Plugins**.
3. Go to **Filter Galleries › Add New** to create your first gallery.
4. Add filter groups and values, upload images, assign filter values, and publish.
5. Copy the shortcode from the sidebar and paste it into any page or post.

== Frequently Asked Questions ==

= Can one image belong to multiple filter values? =

Yes. Each image has a multi-select box per filter group. Hold Ctrl/Cmd to select multiple values — e.g. a cuisine image can be tagged as both India and USA.

= How does the filtering logic work? =

AND logic across groups, OR within a group. If you select Country=India and Room=Kitchen, only images assigned to India (or both India and USA) AND Kitchen are shown.

= Can I customise the image card layout? =

Yes — copy `image-card.php` from the plugin's `templates/` folder to `your-theme/webcasata-filter-gallery/image-card.php` and edit freely. All image data is available as PHP variables.

= How do I show all images without a Load More button? =

Set `per_page="-1"` in the shortcode, or set "Images on Page Load" to -1 in the Settings page.

= Does this plugin slow down my site? =

CSS and JavaScript are only enqueued on pages that contain a gallery shortcode or block. Images use native `loading="lazy"`.

== Screenshots ==

1. Gallery front end with dropdown filters, equal grid layout, and Load More button.
2. Masonry layout with lightbox open showing Visit Link button.
3. Gallery edit screen — Filter Groups builder with drag-and-drop reordering.
4. Gallery edit screen — Image cards with multi-select filter assignment.
5. General Settings page.
6. Shortcode sidebar meta box with copy button.
7. Gutenberg block with live preview in the editor.
8. Template override notice in the gallery list screen.

== Changelog ==

= 1.0.0 =
* Initial release.