Add Site Editor and PHP changes from Gutenberg 10.1 - 11.9
- First pass at adding the site editor from the Gutenberg plugin to wp-admin/site-editor.php. - Adds miscellaneous PHP changes from Gutenberg 10.1 - 11.9. Follows [52042]. See #54337. Props youknowriad, aristath, hellofromtonya, gziolo. Built from https://develop.svn.wordpress.org/trunk@52069 git-svn-id: http://core.svn.wordpress.org/trunk@51661 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
@@ -311,6 +311,12 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
$prepared_args['has_published_posts'] = get_post_types( array( 'show_in_rest' => true ), 'names' );
|
||||
}
|
||||
|
||||
if ( ! empty( $request['has_published_posts'] ) ) {
|
||||
$prepared_args['has_published_posts'] = ( true === $request['has_published_posts'] )
|
||||
? get_post_types( array( 'show_in_rest' => true ), 'names' )
|
||||
: (array) $request['has_published_posts'];
|
||||
}
|
||||
|
||||
if ( ! empty( $prepared_args['search'] ) ) {
|
||||
$prepared_args['search'] = '*' . $prepared_args['search'] . '*';
|
||||
}
|
||||
@@ -1580,6 +1586,15 @@ class WP_REST_Users_Controller extends WP_REST_Controller {
|
||||
),
|
||||
);
|
||||
|
||||
$query_params['has_published_posts'] = array(
|
||||
'description' => __( 'Limit result set to users who have published posts.' ),
|
||||
'type' => array( 'boolean', 'array' ),
|
||||
'items' => array(
|
||||
'type' => 'string',
|
||||
'enum' => get_post_types( array( 'show_in_rest' => true ), 'names' ),
|
||||
),
|
||||
);
|
||||
|
||||
/**
|
||||
* Filters REST API collection parameters for the users controller.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user