我试着用这条线,这是正确的方法吗?
的数据
我得到了这个错误:
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.
字符串
2条答案
按热度按时间wwtsj6pe1#
您不必启用它。
https://yoursite.com/wp-json/namespace/route
这里有一个很好的资源来使用它:
Rest API reference的
628mspwn2#
默认情况下启用该选项。
您可以通过访问
YOUR_WEBSITE.COM/wp-json
访问WordPress REST API。