What’s new in FacetWP 4.3.4
FacetWP 4.3.4 was released on November 21, 2024. This update contains the following improvements, new features and bug fixes:
Export all facets and/or listings for export
We improved the Import/Export feature selection options and UI. It is now possible to select all facets and/or listings for export. And to reset that selection. Handy when you have a lot of facets/listings and want to select them all at once:
Get the unfiltered post count in a “Result counts” Pager facet
It is now possible the use the unfiltered number of posts in a Result counts Pager facet placeholder. The new placeholder name is [total_unfiltered]
. This placeholder can be used for example like this:
Showing [total] of [total_unfiltered] results
The unfiltered number of posts is now also available in the FWP.settings.pager JS object:
How to use custom JavaScript code?
JavaScript code can be placed in your (child) theme's main JavaScript file. Alternatively, you can add it manually between
<script>
tags in the<head>
section of your (child) theme's header.php file. You can also load it with a hook in your (child) theme's functions.php file, or in the Custom Hooks add-on. To load the code only on pages with facets, use thefacetwp_scripts
hook. To load it on all pages, usewp_head
orwp_footer
. Or you can use a code snippets plugin. More info// Get the total number of unfiltered posts FWP.settings.pager.total_rows_unfiltered
And with PHP as part of the pager arguments:
How to use custom PHP code?
PHP code can be added to your (child) theme's functions.php file. Alternatively, you can use the Custom Hooks add-on, or a code snippets plugin. More info
// Display the total number of unfiltered posts echo FWP()->facet->pager_args['total_rows_unfiltered'];
Fixes for several indexing issues when importing posts
This version fixes a bug that caused a 500
fatal error when importing products with WebToffee’s Import Export plugins.
FacetWP’s automatic indexer can also cause several other issues when it is triggered during the importing of posts with the above-mentioned WebToffee plugins, or WP All Import. Our recommendation is to disable the indexer temporarily during the import, and then automatically trigger it after the import process has finished. This version adds code improvements that make this possible.
See these pages for more info and how to do this:
- Fix indexing issues with WP All Import
- Fix indexing issues with WebToffee Import Export for WooCommerce
New “Enable automatic indexing” setting
This version introduces a new setting: “Enable automatic indexing”. This setting is enabled by default.
When disabled, FacetWP will no longer automatically re-index when editing and saving posts and terms. This can be useful if you prefer to re-index manually with the Re-index button, or if you want to (temporarily) pause automatic indexing when importing content or testing your custom re-indexing code. Or, if you are using WP-CLI to trigger re-indexing, or WP-Cron to programmatically trigger non-recurring or recurring re-indexing.
Note that disabling automatic indexing was already possible with the facetwp_indexer_is_enabled hook. This new setting just makes this a bit easier.
Other fixes and improvements
- We fixed a bug introduced in v4.3.2 that prevented the CodeMirror editor from initializing in other plugins with FacetWP installed. This happened in for example XYZ Snippets and Toolset.
- We improved lots of small admin UI styling details. Missing hover styling for the secondary navigation tabs was added.
- When using the “Purge the index table” button, the
facetwp_temp
database table is now also deleted, to thoroughly clean up all data and prevent edge case indexing issues. - When filtering WooCommerce categories, if there are facets in use, categories and subcategories have the facet URL query variables appended to their archive link. A bug was fixed that caused these query variables to also be appended to category links elsewhere on the page.
- An indexing issue was fixed that happened when using FacetWP with WPML, when also using cron indexing (for example with the Schedule Indexer add-on), and the Post Types Order plugin with the “Auto Sort” setting enabled. The issue caused only a single language to be indexed, resulting in posts disappearing from indexed rows and facet options.
- We fixed a bug that happened when indexing a hierarchical facet with its data source set to a WooCommerce attribute taxonomy that has been made hierarchical.