=== Captain Advance Filter ===
Contributors: devangvachheta
Tags: filter, ajax filter, search, elementor, gutenberg
Requires at least: 6.0
Tested up to: 7.0
Requires PHP: 7.4
Stable tag: 1.0.0
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A powerful, lightweight AJAX filter and search plugin for WordPress — works with Elementor, Gutenberg, Bricks, and Shortcodes.

== Description ==

Captain Advance Filter lets you build AJAX-powered filter and search experiences for any post type. Create custom queries, filter sets, and layouts — then embed them via shortcodes, Gutenberg blocks, or Elementor widgets. No coding required.

**Core Features:**

* AJAX filtering and pagination — no page reload
* Visual Query Builder — pick a post type, set ordering, and define which content gets shown
* Filter Set Builder — combine multiple filter fields and link them to a query
* Filter types: Checkbox, Radio, Dropdown, Range (slider), Search, and A-Z alphabetical filter
* Taxonomy and meta-based filtering with WP_Query under the hood (tax_query / meta_query)
* Pagination styles: numbered pagination, load more button, and infinite scroll
* Optional result caching via WordPress transients for faster repeated queries
* React-powered admin dashboard with a clean, modern UI

**Shortcodes:**

* `[captaf-filter id="1"]` — render a filter set
* `[captaf-grid query="query_key"]` — render the filtered content grid
* `[captaf-pagination query="query_key"]` — render pagination controls
* `[captaf-count query="query_key"]` — render the result count

**Builder Integrations:**

* Elementor — dedicated widgets for Filter, Grid, and Pagination, fully stylable in the Elementor editor
* Gutenberg — native blocks for Filter, Grid, and Pagination
* Bricks Builder — support coming soon

**Performance:**

* Lightweight — admin and frontend assets load only on the pages that actually use the plugin
* No jQuery dependency on the frontend

== Installation ==

1. Upload the plugin folder to `/wp-content/plugins/`
2. Activate the plugin from the **Plugins** screen in WordPress
3. Go to **Captain Advance Filter** in your admin menu
4. Create a Query, then a Filter Set linked to that query
5. Embed using `[captaf-filter id="1"]` and `[captaf-grid query="your_query_key"]`

== Frequently Asked Questions ==

= Does it work without Elementor? =

Yes. Shortcodes and Gutenberg blocks are supported out of the box. Elementor is an optional integration.

= Can I filter custom post types? =

Yes. Any publicly viewable post type registered in WordPress can be used as a query source.

= Are the public REST endpoints secure? =

Yes. The `/filter` endpoint verifies that the queried post type is publicly viewable before returning results. The `/filter-options` endpoint only exposes options for publicly queryable taxonomies. No private data is accessible through these endpoints.

= Do I need to know how to code? =

No. Everything — queries, filter sets, and layouts — is configured through the visual admin dashboard. Shortcodes are provided automatically once you create a query or filter set.

= Will this slow down my site? =

No. Plugin assets are only enqueued on pages where you actually use a shortcode, Gutenberg block, or Elementor widget from Captain Advance Filter.

== Screenshots ==

1. Dashboard overview
2. Query builder
3. Filter set configuration
4. Frontend filter in action

== Changelog ==

= 1.0.0 =
**Initial stable release.**

* Added six filter types: Checkbox, Radio, Dropdown, Range Slider, Search, A–Z Alphabetical
* Added three pagination modes: Numbered Pagination, Load More, Infinite Scroll
* Added Elementor widgets.
* Added Gutenberg blocks.
* Added Visual Query Builder for creating reusable post queries.
* Added Filter Set Builder with support for multiple filters.
* Added customizable grid layouts with column switcher support.
* Added AJAX filtering with live result updates.
* Added live result count shortcode.
* Added four frontend shortcodes: `[captaf-filter]`, `[captaf-grid]`, `[captaf-pagination]`, `[captaf-count]`
* Added caching support for improved performance.
* Added React-powered admin dashboard.
* Added integrations page and plugin settings.
* Added REST API for frontend filtering and admin management.
* Added conditional asset loading for better frontend performance.
* Added security hardening and input sanitization.
* Added dark and light mode support for the admin dashboard with one-click theme switching.

== Upgrade Notice ==

= 1.0.0 =
First stable public release. Full feature set, security hardened, approved on WordPress.org. Safe to install fresh or upgrade from 0.0.x.
