I apologize for my ignorance. This plugin looks great to me. But I’m having trouble because it doesn’t auto flush.I too have unknown in my EndPoint but I cannot understand from the faq how to proceed. There is a file that I need to edit. If so where do I find this file. Excuse me but I’m at the beginning.
Where I can do this?
Yes you can! Use the hook wp_rest_cache/determine_object_type like this:
function wprc_determine_object_type( $object_type, $cache_key, $data, $uri ) {
if ( $object_type !== ‘unknown’ || strpos( $uri, $this->namespace . ‘/’ . $this->rest_base ) === false ) {
return $object_type;
}
// Do your magic here
$object_type = ‘website’;
// Do your magic here
return $object_type;
}
add_filter( ‘wp_rest_cache/determine_object_type’, ‘wprc_determine_object_type’, 10, 4 );
Thanks in advance
-
This reply was modified 4 years, 6 months ago by csacchetti.