I actually debugged this and found the problem. It is directly related to creating a post via the REST API.
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.
Related Posts:
- “Add Media” button in custom plugin
- Disabled plugins are they security holes – rumor or reality?
- How to run Two WordPress blogs with different themes and with single database and same content
- “Donate to this plugin” for WordPress.org Plugin Authors
- When coding a WordPress theme, where does the theme (i.e. the presentation) end and the plugin (i.e. the functionality) begin?
- Core framework/helpers for logging stuff?
- Disable Specific Widgets on Selected Pages of a WordPress Website?
- How to handel multiple checkbox field in the admin settings page with Settings API
- Are orders of magnitude used for “Active Installs”?
- To remove plugin notices for non-admin users
- How to notify users of blog updates a la Admin Plugin Update notifications?
- How can I force a “404 Not Found” error
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- Files being generated in multiple directories supposedly by WordPress (advanced_settings.php and common_config.php)
- Is there a plugin that allows a user of your site to get an email from you with an attachment?
- An old plugin self-made stoped sending mail
- How to install a plugin for a free WordPress site? [duplicate]
- WordPress Plugin Look & Feel
- Best Way to Remove WordPress Meta Box based on Post Status
- How to see list of plugins
- Localize Plugin Description
- Display future posts?
- Can’t find plugins in menu for wordpress 3.2?
- How to add pagination to wpbakery grid?
- Variable from a plugin into a theme
- Override plugin text domain in child theme
- update_user_meta add value on the top on existing value
- Can a plugin still effect a site even after deletion?
- How to get variables from fucntion.php to my plugin files
- Delete Associated Media Upon Page / Post Deletion
- Why wp_mail() function isn’t sending any emails and displaying ‘0’ in Chrome ‘Network’ response
- How can I display a contact form for out of stock products in WooCommerce?
- How to disable specific plugin in mobile version?
- Headers already sent when I try to add headers via a shortcode
- Test files for plugin development
- CodeColorer: Allow Some Symbols in Java Language
- Outbound Click Tracking
- Error with Image Slide plug-in/ s3slider in WP
- How to add an automatic refresh in WordPress for a Page/Post or an embedded OneDrive/Excel HTML Code?
- WordPress Backend HA (Automatic failover)
- How to allow user to select User ID in Formidable Pro form? [closed]
- How to Display WordPress Plugins in Normal Website (Without WordPress)?
- Custom Shortcode Broken in WordPress 3.1
- How to embed .mp4 videos in a WordPress post?
- Detailed form plugin, with ability to export to excel etc. OR edit PDF live? [closed]
- How to get plugin name from plugin file location
- How do i edit the plugin files in DataBase via phpMyAdmin?
- What is the best way to cache pages on WordPress
- Sticky option for custom post types without using custom fields or plugins
- Let users sell video in my website [closed]
- Stop wordpress from requesting external jquery from googleapi
- how do i change my website facebook login button to another text immediately user login? [closed]
- WordPress Social Sharing Icons – Custom Placement
- check uncategorized category by default
- “Deregister” plugin from frontend or specific pages?
- Using meta_query in a WP_Query not working for numbers properly
- How to get rid of Ellipsis on Woocommerce [Essential] Theme [closed]
- Some images on WordPress site are suddenly gone
- How to add captcha to publish widget
- Permalinks and pagination are not working in WordPress with WP e-Commerce plugin
- Dynamic Rating Plugin to Add Anywhere
- apply_filters(woocommerce_get_item_data, …) Causing errors when adding to cart
- How to add logo to a WordPress Custom Plugin?
- How can i find the cron jobs that run on my site and then move them to the server side?
- Using OR Condition with facetwp facets
- insert og image link in wordpress post
- How to copy the all WordPress media items to another custom plugin folder?
- Bulk Edit Media Library alt, caption, image names
- WordPress is redirecting me to homepage
- Plugin updated pushed with git break site
- Forbidden 403 Access to this resource on the server is denied
- Error on plugin activation and creating new page
- Child theme modifications not showing up
- Moving a few select DB tables to a new WP instance
- “Fire Secure” menu item
- User Following System
- How to get the total count of Favorite/Favorited authors
- Can Hosting affect a plugin from working properly?
- WP default file upload hook not working if used in a plugin
- My own metabox checkbox plugin only saves the last value I’ve checked
- Admin page and admin menu. Permissions plugin
- How to create a new database table whenever user changes options
- Plugin’s required JS not being inserted in my theme
- How to redirect from plugin page
- Display alt text as tool tip on page
- Gravity Forms Salesforce field mapping for custom objects
- What is the Object for WP_Error Class?
- Plugin:Read More Right Here , How to change the name (more…) to Read More
- How do I output user_registered time in my correct timezone?
- Ajax in Plugins: returns the whole page
- How do I locate specific file in a post that affects ssl?
- Looking for Plugin that displays Facebook group’s photos [closed]
- Publishing tweets from wordpress [closed]
- WordPress Plugins Error
- How do I put a word-press blog into my static site without installing wordpress on server?
- Translate text for empty product
- Am having issues intergrating this api into my wordpress site, any help please?
- wp_enqueue_script doesn’t load JS in plugin
- AI Code For OpenAI
- How to Deobfuscate a sourcecop protected WordPress plugin?