Applying fix from a255340efc6dfe05478adfaa55a8759f8c2c5951 into Posts Controller.

- Props @NateWr
Remove return type from WP_JSON_Controller::get_items.
Move checking of post type into separate method.
Correct return type to WP_JSON_Response object in Docblocks.