Title: WP REST API tutorial
Last modified: February 17, 2020

---

# WP REST API tutorial

 *  Resolved [Koli14](https://wordpress.org/support/users/koli14/)
 * (@koli14)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/wp-rest-api-tutorial/)
 * If you want to use it through the rest api, you need to add the following code
   to your functions.php:
 *     ```
       //Add menu order support for REST API
       add_filter( 'rest_post_collection_params', 'my_prefix_add_rest_orderby_params', 10, 1 );
       function my_prefix_add_rest_orderby_params( $params ) {
           $params['orderby']['enum'][] = 'menu_order';
   
           return $params;
       }
       ```
   
 * Then, query e.g: `https://yoursite.com/wp-json/wp/v2/posts?orderby=menu_order&
   order=asc`
    Thanks for the plugin, it’s great! 🙂

Viewing 1 replies (of 1 total)

 *  [Miha](https://wordpress.org/support/users/mplusb/)
 * (@mplusb)
 * [6 years, 3 months ago](https://wordpress.org/support/topic/wp-rest-api-tutorial/#post-12449417)
 * Thank you, [@koli14](https://wordpress.org/support/users/koli14/)!

Viewing 1 replies (of 1 total)

The topic ‘WP REST API tutorial’ is closed to new replies.

 * ![](https://ps.w.org/simple-custom-post-order/assets/icon-256x256.jpg?rev=2969435)
 * [Simple Custom Post Order](https://wordpress.org/plugins/simple-custom-post-order/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-custom-post-order/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-custom-post-order/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-custom-post-order/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-custom-post-order/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-custom-post-order/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Miha](https://wordpress.org/support/users/mplusb/)
 * Last activity: [6 years, 3 months ago](https://wordpress.org/support/topic/wp-rest-api-tutorial/#post-12449417)
 * Status: resolved