wpseek.com
Eine auf WordPress spezialiserte Suchmaschine für Entwickler und Theme-Autoren



rest_{$this->post_type}_query › WordPress Filter Hooks

Seit5.7.0
Veraltetn/v
apply_filters( "rest_{$this->post_type}_query", $args, $request )
Parameter: (2)
  • (array) $args Array of arguments to be passed to WP_Query.
    Erforderlich: Ja
  • (WP_REST_Request) $request The REST API request.
    Erforderlich: Ja
Definiert in:
Codex:

Filters WP_Query arguments when querying users via the REST API.

The dynamic portion of the hook name, $this->post_type, refers to the post type slug.

Possible hook names include:

  • rest_post_query
  • rest_page_query
  • rest_attachment_query

Enables adding extra arguments or setting defaults for a post collection request.





Quellcode

$args       = apply_filters( "rest_{$this->post_type}_query", $args, $request );