Get rest_base value from a post type
-
Hi.
Is there a way to retrieve the value of the
rest_base
from a specific post type so I can use in my endpoints?
Something like this:$rest_base = get_rest_base('my_type'); wp_localize_script('my-script', 'foo', array('bar' => esc_url_raw(rest_url()).'/wp/v2/'.$rest_base) );
Best regards.
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Get rest_base value from a post type’ is closed to new replies.