Cache doesn’t work
-
Hello
I’ve tried a lot of times this plugin with custom methods and added function below but cache doesn’t works anyway.(add_action( 'rest_api_init', function () { register_rest_route( 'places', 'all', array( 'methods' => 'GET', 'callback' => 'api_get_places_all', ) ); } );
and tried with version define like this:
add_action( 'rest_api_init', function () { register_rest_route( 'v1/places', 'all', array( 'methods' => 'GET', 'callback' => 'api_get_places_all', ) ); } );
——
function wprc_add_places_list_endpoint( $allowed_endpoints ) { if ( ! isset( $allowed_endpoints[ 'places' ] ) || ! in_array( 'all', $allowed_endpoints[ 'places' ] ) ) { $allowed_endpoints[ 'places' ][] = 'all'; } return $allowed_endpoints; } add_action( 'wp_rest_cache/allowed_endpoints', 'wprc_add_places_list_endpoint', 10, 1);
Maybe plugin require any server settings for normal functionality?
- This topic was modified 2 years, 9 months ago by .
- This topic was modified 2 years, 9 months ago by .
The page I need help with: [log in to see the link]
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Cache doesn’t work’ is closed to new replies.