diff --git a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php index 30651d0538..7e3e5636c4 100644 --- a/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php +++ b/wp-includes/rest-api/endpoints/class-wp-rest-posts-controller.php @@ -220,7 +220,10 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { if ( isset( $registered['sticky'], $request['sticky'] ) ) { $sticky_posts = get_option( 'sticky_posts', array() ); - if ( $sticky_posts && $request['sticky'] ) { + if ( ! is_array( $sticky_posts ) ) { + $sticky_posts = array(); + } + if ( $request['sticky'] ) { /* * As post__in will be used to only get sticky posts, * we have to support the case where post__in was already @@ -234,7 +237,7 @@ class WP_REST_Posts_Controller extends WP_REST_Controller { * so we have to fake it a bit. */ if ( ! $args['post__in'] ) { - $args['post__in'] = array( -1 ); + $args['post__in'] = array( 0 ); } } elseif ( $sticky_posts ) { /* diff --git a/wp-includes/version.php b/wp-includes/version.php index 6865b70e3a..6c0a7e9471 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.8-alpha-40121'; +$wp_version = '4.8-alpha-40122'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.