Make WordPress Core

Opened 9 years ago

Closed 9 years ago

#43184 closed enhancement (worksforme)

WP REST API: Filter page / post lists based on permalink

Reported by: miztroh Owned by:
Priority: normal Milestone:
Component: REST API Version: 4.7
Severity: normal Keywords:
Cc: Focuses:

Description

With the REST API, is it possible to query for pages / posts and filter by permalink? Something along the lines of /wp-json/wp/v2/posts?filter[permalink]=/2015/11/29/hello-world/.

See the previous discussion at https://github.com/WP-API/WP-API/issues/1776.

I'm reposting this here because the repo says the following:

"The WP REST API has been merged into WordPress core. Please do not create issues or send pull requests. Submit support requests to the forums or patches to Trac (see README below for links)."

I think this could be a really great feature and I don't want the request to get lost in a sea of Github issues that no one is checking.

Thank you!

Change History (1)

#1 @johnbillion
9 years ago

  • Milestone Awaiting Review
  • Resolutionworksforme
  • Status newclosed
  • Version trunk4.7

Yep! There's a slug parameter that you can use. It doesn't accept the full permalink, just the slug of the post which in your example is hello-world.

Docs here: https://developer.wordpress.org/rest-api/reference/posts/

Note: See TracTickets for help on using tickets.