Answers for "turn off wordpress user list exposed"

PHP
0

turn off wordpress user list exposed

add_filter( 'rest_endpoints', function( $endpoints ){
    if ( isset( $endpoints['/wp/v2/users'] ) ) {
        unset( $endpoints['/wp/v2/users'] );
    }
    if ( isset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] ) ) {
        unset( $endpoints['/wp/v2/users/(?P<id>[\d]+)'] );
    }
    return $endpoints;
});
Posted by: Guest on November-12-2020

Code answers related to "turn off wordpress user list exposed"

Browse Popular Code Answers by Language