注册功能必须去哪里?( register_rest_route())
有任何文件可以澄清这一点吗?
官方文档中没有提到: https://developer.wordpress.org/rest-api/extending-the-rest-api/routes-and-endpoints/
同样,端点函数必须存储在哪里?注册函数只是命名它,而不指定它的路径。
例如,你可以这样做:
register_rest_route) 位于主插件文件中(例如 \wp-content\plugins\example\example.php)如果是这样,怎么办?
以下链接似乎尝试执行此操作,但未指定这些属性(例如 \wp-content\plugins\example\example.php)
php wordpress routes wordpress-rest-api wordpress-plugin-creation