]> scripts.mit.edu Git - autoinstalls/wordpress.git/blobdiff - wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php
WordPress 4.7.1
[autoinstalls/wordpress.git] / wp-includes / rest-api / endpoints / class-wp-rest-users-controller.php
index 01542a9b6bdbc36a97cfcfee98e3f5ef6de1a9eb..3e44884a3c19538b27e38cb8a516cc0dabc6189a 100644 (file)
@@ -248,7 +248,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
                }
 
                if ( ! current_user_can( 'list_users' ) ) {
-                       $prepared_args['has_published_posts'] = true;
+                       $prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' );
                }
 
                if ( ! empty( $prepared_args['search'] ) ) {
@@ -1351,7 +1351,7 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
                 *
                 * @since 4.7.0
                 *
-                * @param $params JSON Schema-formatted collection parameters.
+                * @param array $query_params JSON Schema-formatted collection parameters.
                 */
                return apply_filters( 'rest_user_collection_params', $query_params );
        }