Skip to content

Instantly share code, notes, and snippets.

Created September 30, 2015 20:49
Show Gist options
  • Select an option

  • Save anonymous/d8b15be6105a9aa7ff78 to your computer and use it in GitHub Desktop.

Select an option

Save anonymous/d8b15be6105a9aa7ff78 to your computer and use it in GitHub Desktop.
// All posts belonging to author with nicename "jadenbeirne"
wp.posts().filter( 'author_name', 'jadenbeirne' ).get();
// All posts in category "islands" and tags "clouds" & "sunset"
// (filter can either accept two parameters, as above where it's called with
// a key and a value, or an object of parameter keys and values, as below)
wp.posts().filter({
category_name: 'islands',
tag: [ 'clouds', 'sunset' ]
}).get();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment