Skip to content
This repository was archived by the owner on Sep 24, 2018. It is now read-only.
This repository was archived by the owner on Sep 24, 2018. It is now read-only.

Pass WP_REST_Request to prepare_items_query in WP_REST_Posts_Controller #2207

Description

@mgburns

Use case:

I'm extending the built-in WP_REST_Posts_Controller class to provide extra collection parameters / WP_Query arguments (sort by meta field, filter by P2P connected posts, etc.) for a custom post type endpoint.

AFAICT there is no way to do this without duplicating all of the code in WP_REST_Posts_Controller::get_items() as I need the current WP_REST_Request object to add the appropriate query arguments.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      Sponsor
      SponsoredKunjungi sekarang
      Promo