~canonical-sysadmins/wordpress/5.1

« back to all changes in this revision

Viewing changes to wp-includes/rest-api/endpoints/class-wp-rest-users-controller.php

  • Committer: Jamon Camisso
  • Date: 2017-01-12 15:30:45 UTC
  • mto: This revision was merged to the branch mainline in revision 25.
  • Revision ID: jamon.camisso@canonical.com-20170112153045-dekfwsu8mcsdxa7x
New upstream release 4.7.1

Show diffs side-by-side

added added

removed removed

Lines of Context:
248
248
                }
249
249
 
250
250
                if ( ! current_user_can( 'list_users' ) ) {
251
 
                        $prepared_args['has_published_posts'] = true;
 
251
                        $prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' );
252
252
                }
253
253
 
254
254
                if ( ! empty( $prepared_args['search'] ) ) {
1351
1351
                 *
1352
1352
                 * @since 4.7.0
1353
1353
                 *
1354
 
                 * @param $params JSON Schema-formatted collection parameters.
 
1354
                 * @param array $query_params JSON Schema-formatted collection parameters.
1355
1355
                 */
1356
1356
                return apply_filters( 'rest_user_collection_params', $query_params );
1357
1357
        }