📜  关闭暴露的wordpress用户列表 - PHP代码示例

📅  最后修改于: 2022-03-11 14:53:43.752000             🧑  作者: Mango

代码示例1
add_filter( 'rest_endpoints', function( $endpoints ){
    if ( isset( $endpoints['/wp/v2/users'] ) ) {
        unset( $endpoints['/wp/v2/users'] );
    }
    if ( isset( $endpoints['/wp/v2/users/(?P[\d]+)'] ) ) {
        unset( $endpoints['/wp/v2/users/(?P[\d]+)'] );
    }
    return $endpoints;
});