REST API插件Wordpress禁用默认路由 [英] Rest API plugin wordpress disable default routes
本文介绍了REST API插件Wordpress禁用默认路由的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
您好,请帮我安装REST API插件WP,并添加一些特定的路由,以及所有可以正常使用的东西,因为我不会.但是我想禁用默认路由示例: /wp-json/ /wp-json/wp/v2/posts
Hello guy's Please help me i install REST API plugin WP and i adding some specific route and any things it's work fine as i wont. But I want to disable default route exemple : /wp-json/ /wp-json/wp/v2/posts
推荐答案
您可以在插件上使用它来删除所有默认路由.
You can use this on your plugin for remove all default route.
remove_action( 'rest_api_init', 'create_initial_rest_routes', 0 );
这篇关于REST API插件Wordpress禁用默认路由的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文