$name, 'available' => $available, ); if ( ! tinv_get_option( 'integrations', $slug ) ) { return; } if ( ! $available ) { return; } if ( defined( 'LSWCP_PLUGIN_URL' ) ) { // Force ESI nonce. if ( ! function_exists( 'tinvwl_litespeed_conf_esi_nonce' ) ) { add_action( 'wp_enqueue_scripts', 'tinvwl_litespeed_conf_esi_nonce', 9 ); add_action( 'litespeed_load_thirdparty', 'tinvwl_litespeed_conf_esi_nonce' ); function tinvwl_litespeed_conf_esi_nonce() { do_action( 'litespeed_nonce', 'wp_rest' ); } } // Force exclude URL if ( ! function_exists( 'tinvwl_litespeed_conf_exc_uri' ) ) { add_action( 'init', 'tinvwl_litespeed_conf_exc_uri' ); function tinvwl_litespeed_conf_exc_uri() { $val = apply_filters( 'litespeed_conf', 'cache-exc' ); $ids = array( tinv_get_option( 'page', 'wishlist' ), ); $pages = $ids; $languages = apply_filters( 'wpml_active_languages', array(), array( 'skip_missing' => 0, 'orderby' => 'code', ) ); if ( ! empty( $languages ) ) { foreach ( $ids as $id ) { foreach ( $languages as $l ) { $pages[] = apply_filters( 'wpml_object_id', $id, 'page', true, $l['language_code'] ); } } $pages = array_unique( $pages ); } $pages = array_filter( $pages ); if ( ! empty( $pages ) ) { foreach ( $pages as $i => $page ) { $pages[ $i ] = preg_replace( "/^\//", '', rtrim( str_replace( get_site_url(), '', get_permalink( absint( $page ) ) ), '/' ) ); // @codingStandardsIgnoreLine Squiz.Strings.DoubleQuoteUsage.NotRequired } } $pages = array_unique( $pages ); $pages = array_filter( $pages ); $val = array_unique( array_merge( $val, $pages ) ); do_action( 'litespeed_conf_force', 'cache-exc', $val ); } } }