danlapteacru / facetwp-local-json
Saves FacetWP facets, templates and settings as .json files within your theme.
Installs: 5
Dependents: 0
Suggesters: 0
Security: 0
Stars: 3
Watchers: 2
Forks: 0
Type:wordpress-plugin
Requires
- php: ^8.1
Requires (Dev)
This package is auto-updated.
Last update: 2025-03-21 00:43:34 UTC
README
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.
Minimum Requirements
- PHP v8.1
- WordPress v6.1
- FacetWP v4.0
Installation
Composer (Recommended)
composer require danlapteacru/facetwp-local-json
WP-CLI
wp plugin install facetwp-local-json --activate
wordpress.org plugins directory
Download from https://wordpress.org/plugins/facetwp-local-json and install it manually or via WordPress admin panel.
Hooks
facetwp_local_json_settings
Filter the settings that are stored in the .json file.
Example:
add_filter( 'facetwp_local_json_settings', fn (array $settings): array => [ ...$settings, $settings['general']['auto_refresh'] = true, ], );
facetwp_local_json_storage_path
Filter the path where the .json files are stored.
Default is wp-content/themes/your-theme/plugins/facetwp/local-json/settings.json
.
Example:
add_filter( 'facetwp_local_json_storage_path', fn (): string => get_theme_file_path('facetwp/settings.json'), );
Constants
FACETWP_LOCAL_JSON_STORAGE_PATH
Define the path where the .json files are store in your wp-config.php
file.
Example:
define('FACETWP_LOCAL_JSON_STORAGE_PATH', get_theme_file_path('facetwp/settings.json'));
FACETWP_LOCAL_JSON_FORCE_ENABLE
Force enable/disable the FacetWP Local JSON features.
Example:
define('FACETWP_LOCAL_JSON_FORCE_ENABLE', true);
TODO
- Add support for WPML and Polylang.
- Option to select which facets, templates and settings to store in the .json file.
- Tests.
- Documentation.
Credits
FacetWP Local JSON is created by Dan Lapteacru.
Full list of contributors can be found here.
License
FacetWP Local JSON is released under the MIT License.