PHP code example of danlapteacru / facetwp-local-json

1. Go to this page and download the library: Download danlapteacru/facetwp-local-json library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

danlapteacru / facetwp-local-json example snippets


add_filter(
    'facetwp_local_json_settings', 
    fn (array $settings): array => [
        ...$settings,
        $settings['general']['auto_refresh'] = true,
    ],
);

add_filter(
    'facetwp_local_json_storage_path', 
    fn (): string => get_theme_file_path('facetwp/settings.json'),
);

define('FACETWP_LOCAL_JSON_STORAGE_PATH', get_theme_file_path('facetwp/settings.json'));

define('FACETWP_LOCAL_JSON_FORCE_ENABLE', true);