As the sun rises and the forest mist clears, and the clouds return and the caves darken, these changes of light and shadow are the morning and evening in the mountains. Wildflowers bloom with their subtle fragrance, fine trees flourish with their dense shade, the wind and frost are pure and clean, and the water recedes to reveal the rocks—these are the four seasons in the mountains. Going out in the morning and returning in the evening, the scenery of the four seasons is different, and the joy is endless.至于负者歌于途,行者休于树,前者呼,后者应,伛偻提携,往来而不绝者,滁人游也。临溪而渔,溪深而鱼肥,酿泉为酒,泉香而酒洌,山肴野蔌,杂然而前陈者,太守宴也。宴酣之乐,非丝非竹,射者中,弈者胜,觥筹交错,起坐而喧哗者,众宾欢也。苍颜白发,颓然乎其间者,太守醉也。
<?php
/**
* The Third Party integration with FacetWP.
*
* @since 2.9.9
* @package LiteSpeed
* @subpackage LiteSpeed_Cache\Thirdparty
*/
namespace LiteSpeed\Thirdparty;
defined('WPINC') || exit();
/**
* FacetWP compatibility hooks for LiteSpeed Cache.
*/
class Facetwp {
/**
* Detect FacetWP context and adjust ESI params when FacetWP returns buffered HTML via the "wp" template.
*
* Note: We only *read* POST data here to detect an AJAX context; no privileged action is performed.
* Data is unslashed and sanitized before comparison.
*
* @since 2.9.9
* @return void
*/
public static function detect() {
if ( ! defined( 'FACETWP_VERSION' ) ) {
return;
}
/**
* For Facetwp, if the template is "wp", return the buffered HTML
* So marked as rest call to put is_json to ESI
*/
// phpcs:ignore WordPress.Security.NonceVerification.Missing -- Reading POST to detect FacetWP AJAX; no state change or sensitive action performed.
if ( ! empty( $_POST['action'] ) && ! empty( $_POST['data'] ) && ! empty( $_POST['data']['template'] ) && 'wp' === $_POST['data']['template'] ) {
add_filter( 'litespeed_esi_params', __CLASS__ . '::set_is_json' );
}
}
/**
* Mark ESI response as JSON for FacetWP's "wp" template refreshes.
*
* @since 2.9.9
* @param array $params Existing ESI params.
* @return array Modified ESI params.
*/
public static function set_is_json( $params ) {
$params['is_json'] = 1;
return $params;
}
}