Linux 软件免费装
Banner图

Demfilz Fields and Filters

开发者 demfilz
更新时间 2026年7月21日 07:10
PHP版本: 7.4 及以上
WordPress版本: 7.0
版权: GPLv2 or later
版权网址: 版权信息

标签

woocommerce custom fields filter product filter faceted search

下载

1.0.1

详情介绍:

Demfilz Fields and Filters does two jobs that belong together:
  1. Custom fields - define your own fields (text, number, select, radio, checkbox, date, URL, text area) and attach them to pages, posts, products or any public post type. Editors fill them in from a clean meta box on the edit screen.
  2. Front-end filters - drop the [dfaf_filters] shortcode on any page to show a filter form plus a results grid. Visitors can filter by your custom fields, by tags, categories or any taxonomy, by WooCommerce global attributes (pa_*) and even by custom per-product attributes.
Filtering features Works with or without WooCommerce WooCommerce is optional. Without it you can still define fields for posts and pages and filter them. With WooCommerce active, product support, price sorting and attribute filters light up automatically. For developers Field types live in a registry that the plugin itself uses for every built-in type. Register additional types through the dfaf_field_types filter, adjust queries with dfaf_query_args, decorate option labels with dfaf_option_label and customise result cards with dfaf_result_card_html. Pro version Everything above is free and fully functional. For sites that want more, Fields and Filters Pro is a separate add-on plugin ($19.95 per year) that adds:

安装:

  1. Install and activate the plugin.
  2. Go to Fields & Filters -> Fields and define your custom fields.
  3. Edit a page, post or product and fill in the new fields in the Custom fields meta box.
  4. Go to Fields & Filters -> Filters, build your shortcode and paste it into any page.
  5. (WooCommerce stores) open Fields & Filters -> Settings and click Rebuild attribute index once so existing custom product attributes become filterable.

屏幕截图:

  • The Custom fields meta box on a product.
  • The front-end filter form and results grid.
  • The shortcode builder.
  • Settings.

升级注意事项:

1.0.1 Output escaping hardening. 1.0.0 Initial release.

常见问题:

How do I filter by WooCommerce global attributes?

Global attributes are taxonomies named pa_something. Add them to the shortcode, for example: [dfaf_filters post_type="product" taxonomies="pa_colour,pa_size"].

How do I filter by custom (per-product) attributes?

Use the attributes parameter, for example: [dfaf_filters post_type="product" attributes="material"]. The plugin indexes custom attribute values automatically when a product is saved; run Rebuild attribute index in Settings to index products that existed before the plugin was installed.

Can visitors pick more than one value?

Yes. List the field keys or taxonomies in the multi parameter and they render as checkbox lists, for example: [dfaf_filters post_type="product" taxonomies="pa_colour" multi="pa_colour"].

Can I put the filter form in a sidebar and the results on the shop page?

Yes. Use [dfaf_filters post_type="product" form_only="1" action="/shop/"] for the form, then enable Archive filtering in Settings so the shop archive applies the filters.

Does it slow my site down?

No. Values are stored as normal post meta and queried with standard meta and taxonomy queries. Custom product attributes are pre-indexed on save specifically so filtering never has to parse serialized data.

Where is the data stored?

Field definitions are a single option; values are post meta prefixed with dfaf. On uninstall the plugin removes its options, and also the post meta if you opted in on the Settings page.

Is there a Pro version?

Yes. Fields and Filters Pro is a separate add-on plugin ($19.95 per year) that adds instant AJAX filtering, live result counts on filter options, colour swatch and star rating field types, and pill-style controls. See https://demfilz.com/fields-and-filters. The free plugin is complete on its own and never locks features.

更新日志:

1.0.1 1.0.0