}
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'] ) ) {
*
* @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 );
}