// 在账号未登录时禁用wp-json/wp/v2/,防止泄露信息 add_filter('rest_authentication_errors',function($result) { if( !empty($result) ) { return$result; } if( ! is_user_logged_in() ) { returnnewWP_Error('Access denied','You have no permission to handle it.',array('status'=> 401 ...