[password key=201821105143]
function.php文件添加下面代码。
- /* 禁止WordPress程序REST API功能且移除wp-json链接 开始*/
- //屏蔽 REST API
- add_filter(‘json_enabled’, ‘__return_false’ );
- add_filter(‘json_jsonp_enabled’, ‘__return_false’ );
- add_filter(‘rest_enabled’, ‘__return_false’);
- add_filter(‘rest_jsonp_enabled’, ‘__return_false’);
- // 移除头部 wp-json 标签和 HTTP header 中的 link
- remove_action(‘wp_head’, ‘rest_output_link_wp_head’, 10 );
- remove_action(‘template_redirect’, ‘rest_output_link_header’, 11 );
- /* 禁止WordPress程序REST API功能且移除wp-json链接 结束*/
[/password]
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系贝贝进行处理。本站默认解压密码:www.hibbba.com


评论(0)