REST Api init errow when changing rest URL
-
Hi,
I can’t correctly load your plugin and i’m getting the “The Rest API is disabled or broken” error.After spending some time debugging I found out that the problem may be due to the fact that in my
functions.phpI change the rest prefix using the following filter:add_filter( 'rest_url_prefix', 'my_api_slug'); function my_api_slug( $slug ) { return 'api'; }It seams that the rest prefix is changed after the execution of the
MeowCommon_Helpers::is_rest();therefore when you try to get the$rest_url['path']it returns “wp-json” instead of “api”.As temporary fix I disabled the
rest_url_prefixfilter, but i need to find a way to make your plugin work with the custom rest prefix.Can you help me, please ?
Best,
A.
The topic ‘REST Api init errow when changing rest URL’ is closed to new replies.