FacetWP Local JSON is a WordPress plugin that allows you to store FacetWP facets, templates and settings as .json file and keep them in your source code repository.
- PHP v8.1
- WordPress v6.1
- FacetWP v4.0
composer require danlapteacru/facetwp-local-json
wp plugin install facetwp-local-json --activate
Download from https://wordpress.org/plugins/facetwp-local-json and install it manually or via WordPress admin panel.
Filter the settings that are stored in the .json file.
add_filter(
'facetwp_local_json_settings',
fn (array $settings): array => [
...$settings,
$settings['general']['auto_refresh'] = true,
],
);
Filter the path where the .json files are stored.
Default is wp-content/themes/your-theme/plugins/facetwp/local-json/settings.json
.
add_filter(
'facetwp_local_json_storage_path',
fn (): string => get_theme_file_path('facetwp/settings.json'),
);
Define the path where the .json files are store in your wp-config.php
file.
define('FACETWP_LOCAL_JSON_STORAGE_PATH', get_theme_file_path('facetwp/settings.json'));
Force enable/disable the FacetWP Local JSON features.
define('FACETWP_LOCAL_JSON_FORCE_ENABLE', true);
- Add support for WPML and Polylang.
- Option to select which facets, templates and settings to store in the .json file.
- Tests.
- Documentation.
FacetWP Local JSON is created by Dan Lapteacru.
Full list of contributors can be found here.
FacetWP Local JSON is released under the MIT License.