WordPress Rest API query parameters mappings

This array defines mappings between public API query parameters whose values are accepted as-passed, and their internal WP_Query parameter name equivalents (some are the same). Only values which are also present in registered will be set.

Below is the list of all the endpoints which have query parameters mapping:

  • wp/v2/comments
  • wp/v2/<post-type>
  • wp/v2/<taxonomy>
  • wp/v2/<term>
  • wp/v2/<users>

Check below list of parameters mapping by Rest API endpoints:

wp/v2/comments

$parameter_mappings = array(
    'author'         => 'author__in',
    'author_email'   => 'author_email',
    'author_exclude' => 'author__not_in',
    'exclude'        => 'comment__not_in',
    'include'        => 'comment__in',
    'offset'         => 'offset',
    'order'          => 'order',
    'parent'         => 'parent__in',
    'parent_exclude' => 'parent__not_in',
    'per_page'       => 'number',
    'post'           => 'post__in',
    'search'         => 'search',
    'status'         => 'status',
    'type'           => 'type',
);

wp/v2/<post-type>

$parameter_mappings = array(
    'author'         => 'author__in',
    'author_exclude' => 'author__not_in',
    'exclude'        => 'post__not_in',
    'include'        => 'post__in',
    'menu_order'     => 'menu_order',
    'offset'         => 'offset',
    'order'          => 'order',
    'orderby'        => 'orderby',
    'page'           => 'paged',
    'parent'         => 'post_parent__in',
    'parent_exclude' => 'post_parent__not_in',
    'search'         => 's',
    'slug'           => 'post_name__in',
    'status'         => 'post_status',
);

wp/v2/<taxonomy>

$parameter_mappings = array(
    'exclude'    => 'exclude',
    'include'    => 'include',
    'order'      => 'order',
    'orderby'    => 'orderby',
    'post'       => 'post',
    'hide_empty' => 'hide_empty',
    'per_page'   => 'number',
    'search'     => 'search',
    'slug'       => 'slug',
);

wp/v2/<term>

       
$parameter_mappings = array(
    'exclude'    => 'exclude',
    'include'    => 'include',
    'order'      => 'order',
    'orderby'    => 'orderby',
    'post'       => 'post',
    'hide_empty' => 'hide_empty',
    'per_page'   => 'number',
    'search'     => 'search',
    'slug'       => 'slug',
);

wp/v2/<users>

$parameter_mappings = array(
    'exclude'  => 'exclude',
    'include'  => 'include',
    'order'    => 'order',
    'per_page' => 'number',
    'search'   => 'search',
    'roles'    => 'role__in',
    'slug'     => 'nicename__in',
);
Advertisements

Register or Enqueue Google fonts in WordPress Theme

A valid way to register the Google fonts in the theme or plugin.

Introducing Astra fastest, fully customizable & beautiful WordPress theme

Hey Guys,

Just wanted to let you know that Astra fastest, fully customizable & beautiful WordPress theme.

Download: Click to Download

Preview


Home: https://wpastra.com/
Blog: https://wpastra.com/blog/
Documentation: https://wpastra.com/docs/
Community: Join on Facebook/
Support: https://wpastra.com/support/

 

 

How to release product versions tags on Github?

# View Tags

$ git tag
v0.1
v1.3

# Create a tag for product version release.

$ git tag

# Push the tags.

git push origin --tags

# Get the list of only 1.5.* releases.

$ git tag -l "v1.2*"
v1.2
v1.2-1
v1.2-2
v1.2.3

More more details visit https://git-scm.com/book/en/v2/Git-Basics-Tagging

Since 9/11

Jen Mylo, On Hiatus

On September 11, 2001, I was living in Vermont without a tv, and was splitting my morning between working on a website I was building as a freelancer and working on a shooting schedule for an independent film I was getting ready to produce. I got a call from Melissa, a costume designer that I had become friends with and who was working on the film planning with me, and she told me that a plane had flown into the World Trade Center. I was pretty sure she’d gotten it wrong — she had a tendency toward confusion — but a google search later I was heading to her house to watch.

19 hijackers killed 2,977 people. That number includes 343 fire fighters and 72 law enforcement officers.

We (and at this point it becomes a very loose “we” as I did not support the decision or wave a flag at…

View original post 929 more words

Yoast WordPress SEO Plugin Vulnerable To Hackers

To fix the issue, upgrade to version 1.7.4 immediately.

Source: http://searchengineland.com/yoast-wordpress-seo-plugin-vulnerable-to-hackers-216656

The Scientifically Proven Best Time to Think and Write Creatively

Do you know when the best time to write is? Is it morning, afternoon, or evening?

Just like you, I was curious, so I decided to do a bit of research. The answer I found shocked me.

The Scientifically Proven Best Time to Think and Write Creatively
Courtesy of: Quick Sprout