Cache custom endpoint woocommerce
-
Dear All
Plugin doesn’t work, our code in functions.php:
Please help to understand why.function wprc_add_imserv_prod_posts_endpoint( $allowed_endpoints ) { if ( ! isset( $allowed_endpoints[ 'ims-sort/v1' ] ) || ! in_array( 'products', $allowed_endpoints[ 'ims-sort/v1' ] ) ) { $allowed_endpoints[ 'ims-sort/v1' ][] = 'products'; } return $allowed_endpoints; } add_filter( 'wp_rest_cache/allowed_endpoints', 'wprc_add_imserv_prod_posts_endpoint', 10, 1); function wprc_add_cacheable_request_headers( $cacheable_headers ) { $cacheable_headers['ims-sort/v1/products'] = 'authorization'; return $cacheable_headers; } add_filter('wp_rest_cache/cacheable_request_headers', 'wprc_add_cacheable_request_headers', 10, 1);
The page I need help with: [log in to see the link]
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Cache custom endpoint woocommerce’ is closed to new replies.