csacchetti
Forum Replies Created
-
Forum: Plugins
In reply to: [Polylang] Polylang don’t display flag and corect name of languages in menu“languages” is the name of menu and it repeat it inside the drop-down menu instead of putting the names of the various languages. For example, if I change language in Italian I have in menu “lingua” and in drop-down menu 3 buttons with “lingua” and not the name of three languages I put in site
Forum: Plugins
In reply to: [WP REST Cache] unknown type – cache non Flush when modifthank you very much
Forum: Plugins
In reply to: [WP REST Cache] Custom End Point Flushing AutomaticallyI 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 5 years, 8 months ago by csacchetti.