如何在我的WordPress网站上启用REST API?

ctzwtxfj  于 11个月前  发布在  WordPress
关注(0)|答案(2)|浏览(132)

我试着用这条线,这是正确的方法吗?


的数据
我得到了这个错误:

Fatal error: Uncaught Error: Undefined class constant 'DOWNLOAD_JOBS' in /home/nplusbic/public_html/wp-content/plugins/wpml-translation-management/classes/ATE/REST/Download.php:27 
Stack trace: 
#0 /home/nplusbic/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/Adaptor.php(18): WPML\TM\ATE\REST\Download->get_routes() 
#1 /home/nplusbic/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/API/REST/Base.php(23): WPML\Rest\Adaptor->add_hooks() 
#2 /home/nplusbic/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(151): WPML\Rest\Base->add_hooks() 
#3 /home/nplusbic/public_html/wp-content/plugins/sitepress-multilingual-cms/classes/action-filter-loader/class-wpml-action-filter-loader.php(121): WPML_Action_Filter_Loader->run_factory(Object(WPML\TM\REST\FactoryLoader)) 
#4 /home/nplusbic/public_html/wp-includes/class-wp-hook.php(288): WPML_Action_Filter_Loader->deferred_loader(Object(WP_REST_Server)) 
#5 /home/nplusbic/public_h in /home/nplusbic/public_html/wp-content/plugins/wpml-translation-management/classes/ATE/REST/Download.php on line 27
There has been a critical error on your website.

字符串

wwtsj6pe

wwtsj6pe1#

您不必启用它。
https://yoursite.com/wp-json/namespace/route
这里有一个很好的资源来使用它:
Rest API reference

628mspwn

628mspwn2#

默认情况下启用该选项。
您可以通过访问YOUR_WEBSITE.COM/wp-json访问WordPress REST API。

相关问题