danlapteacru/facetwp-local-json
最新稳定版本:0.1.0
Composer 安装命令:
composer require danlapteacru/facetwp-local-json
包简介
Saves FacetWP facets, templates and settings as .json files within your theme.
README 文档
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.
统计信息
- 总下载量: 6
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-29