Title: Create Post Bug
Last modified: May 16, 2017

---

# Create Post Bug

 *  [weswitt](https://wordpress.org/support/users/weswitt/)
 * (@weswitt)
 * [9 years ago](https://wordpress.org/support/topic/create-post-bug/)
 * I have found that when a post is created via the REST API that the hook callbacks
   happen in a different order from a post created with the admin UI. Specifically
   when the REST API calls wp_insert_post the data does not include any tags passed
   in via the JSON data. This means that if a plugin has a publish_post action set
   and needs to query the tags for the new post it will always fail. Setting a set_object_terms
   action and querying for the tags gives the right result. The problem is that 
   the set_object_terms action happens AFTER the publish_post action. It is expected
   that when the publish_post is called that the tags are available for the new 
   post.

The topic ‘Create Post Bug’ is closed to new replies.

 * ![](https://ps.w.org/rest-api/assets/icon-256x256.png?rev=1346297)
 * [WordPress REST API (Version 2)](https://wordpress.org/plugins/rest-api/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/rest-api/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/rest-api/)
 * [Active Topics](https://wordpress.org/support/plugin/rest-api/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/rest-api/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/rest-api/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [weswitt](https://wordpress.org/support/users/weswitt/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/create-post-bug/)
 * Status: not resolved