=== QueryPress ===
Contributors: pacocarbonell
Tags: search, directory, live search, filter, custom fields
Requires at least: 6.0
Tested up to: 7.1
Requires PHP: 7.4
Stable tag: 0.2.0
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A fast, flexible search and directory plugin. Create records with your own fields and let visitors find them with live search and filters.

== Description ==

QueryPress lets you build a searchable directory for any kind of site: businesses, products, properties, courses, events, members... You define the fields, add your records, and show the search anywhere with a shortcode.

**Main features**

* **Your own fields.** Create text and number fields (price, phone, brand, city...) and choose for each one whether it is searchable, shown as a filter, and shown in the results card.
* **Live search.** Results update while the visitor types, without reloading the page. It still works as a normal form if JavaScript is disabled.
* **Fast on large catalogs.** QueryPress keeps its own search index (MySQL FULLTEXT when available) instead of scanning every record on each search.
* **Forgiving search.** Ignores accents and capital letters and matches the beginning of words, so "jum" finds "Jumilla".
* **Filters.** Dropdown filters, minimum/maximum ranges for numbers, and a category filter.
* **Categories and pagination.**
* **Record page.** Each record gets its own page that shows its fields in a clean table.
* **Your own URLs.** Choose the URL base (for example /directory/ or /products/) and the names used for one record and for all records.
* **Mobile first.** Responsive layout styled with CSS variables, so it is easy to adapt to your theme.
* **Translation ready.** English and Spanish (es_ES) included.
* **Safe uninstall.** Your data is kept when you delete the plugin, unless you explicitly tick the option to remove everything.

**How to use it**

1. Go to QueryPress > Fields and create the fields your records need.
2. Go to QueryPress > Records and add your records.
3. Add the shortcode `[querypress]` to any page.

**Shortcode options**

* `per_page` - number of results per page.
* `category` - show only records from a category (slug).
* `show_filters` - `yes` or `no`.
* `show_category_filter` - `yes` or `no`.

Example: `[querypress per_page="12" category="restaurants"]`

**For developers**

QueryPress offers hooks and filters (prefixed `querypress_`) to extend fields, sanitization, the record page and the post type arguments.

== Installation ==

1. Upload the `querypress` folder to `/wp-content/plugins/`, or install it from the Plugins screen.
2. Activate the plugin.
3. Create your fields in QueryPress > Fields.
4. Add records and place `[querypress]` on a page.

If you import records directly into the database or restore a backup, open QueryPress > Search index and click "Rebuild index".

== Frequently Asked Questions ==

= Does it work with any theme? =

Yes. It uses your theme's page and single templates and adds its own scoped styles.

= Why is a search result missing? =

Open QueryPress > Search index. If it says some records are missing, click "Rebuild index".

= Can I change the URL of the records? =

Yes, in QueryPress > Settings. If your site is already live and indexed, set up redirects from the old URLs.

= What happens to my data if I delete the plugin? =

Nothing, by default. Your fields, settings and records are kept. To remove everything, tick the option in QueryPress > Settings before deleting the plugin.

= Does it add anything to my front end on other pages? =

No. Styles and scripts load only on pages that contain the shortcode.

= Can developers extend QueryPress? =

Yes. Besides the existing filters and actions, QueryPress offers these hooks:

* `querypress_field_value_html` - change the HTML of a value in the cards and on the record page (for example, to make a phone number a link).
* `querypress_filter_option_label` - change the text of the options of a filter dropdown.
* `querypress_container_classes` and `querypress_card_classes` - add CSS classes to the search box and to each result card.
* `querypress_card_start` and `querypress_card_end` - print extra content inside each result card.
* `querypress_sort_rules` - change the order of the results (records first, by a field, by title or by date).

== Screenshots ==

1. The search working on a demo directory, with live results and filters.
2. The Fields screen: add the fields your records need and see the existing ones.
3. Editing a record: title, description and its custom fields.
4. The Settings screen: URL base, labels, results per page and more.
5. The page of a record, with its data in a clean table.

== Changelog ==

= 0.2.0 =
* New hooks for developers: value HTML, filter option labels, container and card classes, card content and result ordering.
* The colours of the search box border and of the button text now use CSS variables.
* Removed an unused duplicate file.

= 0.1.3 =
* Units: optional prefix and suffix for fields (for example € or m²).
* Min/Max range filters, filters limited to the selected category.
* "Back to results" link on the record page.
* Fixes and performance improvements.

= 0.1.0 =
* First public version.
