You omitted how is this function called. I assume it is added to save_post
action.
This action passes current post id as argument. In case of revision that would be revision id and not parent post id. So, as I see it, there is no reason to save additional data for revision (creating duplicate set of it).
Update.
Scratch that.
I looked through source code. Apparently *_post_meta
functions will automatically change to parent post id if passed revision post id. So you might modify original post, thinking you are modifying revision.
Related Posts:
- Stop a plugin in the activation process when a certain WP version is not met then show error message in admin_notices action hook
- How to Add a Third Level Sub Menu to the WordPress Admin Menu
- How to Add an Index to Plugin Database table
- Override WordPress user with Oauth2 account
- How to add “Stick this post to the front page” to front end?
- Creating two database tables via plugin
- Is it a good idea to edit an already existing plugin to add more functionality?
- How to make media upload private? [duplicate]
- How to trace the cause of these PHP notices and warnings for class-wp-query.php?
- Admin plugin, how can I output a different content-type?
- Modify featured image URL at runtime
- Editor access to plugin settings
- Some plugins adding full server path after url (with custom wp-content folder)
- Custom Widget outputs the input but doesn’t save anything inside the textarea
- Woocommerce: Changing the variations select default value? [closed]
- Why load_textdomain work but not load_plugin_textdomain?
- Get uploaded image url
- Akismet plugin is deleting spam despite preferences
- Star rating for custom post types [closed]
- How WordPress knows where to find locale files?
- How to add custom JS to tinymce in wordpress
- Collaborative post submission [closed]
- Reuse javascripts from plugins within the theme
- Correct wp-content ownership and permissions
- How to check what plugins used to be on a WordPress installation?
- Why isn’t “background-image: url”working with Bootstrap carousel on WP?
- Plugin Deactivate Self on Activation Errors
- Form doesn’t submit on second submit call
- What would be the advantages/disadvantages of remote plugin installation?
- How to slice an array using posts_per_page? [closed]
- Should I fetch the data managed by a plugin by using its APIs or WordPress APIs?
- Use translated taxonomy labels in plugin
- Show an image in my header.php
- Plugin appends ugly URL string to index
- Installing a plugin on a premium site [closed]
- White page by using filter template_include
- WordPress Keeps Logging Out – What Tests Can I Run to Solve This?
- Facebook Messager Plugin
- How to save inputed data in a textbox [EDITED] [duplicate]
- User switching only with specific role and return
- WordPress Payment gateway add on form , how to add form into list or else how to submit form to next step for payment
- How WordPress is able to change locale without using setlocale
- Better ads plugin has 500.000 entries in wp_postmeta
- Render Modula Plugin Shortcode On Ajax Request
- Saving widget options from class method
- This WordPress plugin isn’t creating links correctly
- Basics of changing plugin output
- WordPress plugin url for form submit
- syntax error, unexpected ‘while’ (t_while) please help :)
- dynamic name of the style for wp_enqueue_style
- Delete Media not attached with Any posts
- remove ad to cart button and view more button if product price is empty
- how to add a comment button to be displayed only for the posts in the home page [closed]
- Override plugin template
- Should meta boxes for specific pages be save in their own plugins?
- Change plugin author after someone leaves the company
- WordPress Update Question
- How to implement a plugin featuring foursquare like check-in
- “After file loaded” action
- Add_image_size not generating correct size
- navigation among single posts
- Plug-in that shows x number thumbnails from another post
- W3 Total Cache Help – How to update DNS Zone for a static domain [closed]
- Show Homepage (only) Hits Count
- WordPress jQuery Post – Amending Variable Value Within Function Command
- Custom Post Type same name as Category
- how to display recent post by category on home page
- how to define a html folder to make it work with WordPress commands
- Asking help regarding potential malware
- wp_mail function not working in WordPress Plugin Boilerplate
- How To Remove “All, Publish, Draft and Expired” in Events Dashboard
- When/where would want to attach other classes to the base class in a WordPress plugin?
- How to find where an image is used by it’s url
- checkout stripe with plugin contact form
- Disqus comment system not show
- Javascript inserted from Plugin pointing to wrong location
- Custom plugin which downloads updates from custom endpoint, extracts new version zip into a new name
- How to cache for multi server environment? Memcached, Redis or other?
- Page takes on two different formats
- Cant visualize protected password portfolio elements
- How to create multiple pages for PDFs
- Creating a comments voting system
- How to assign plugin to top level menu?
- Rewrite URL to plugin file
- Multiple Accounts on 1 email – Multisite
- Multiselect value in wp_query
- Is it possible to cancel a post status transition?
- Retrieve post thumbnails
- Why are only inactive plugins showing?
- Facebook Like Button with NextGen Gallery
- wordpress plugin JSON API search within specific category
- when i use wp automatic plugin post shows broken images
- how to add “alt” for all image in wordpress
- How to display blog posts only authored by the administrator
- Contact form 7 – How to send mail to two different E-mail Address [closed]
- Seo Problems in My meta Discription [closed]
- how to show the data from a myqsl database in a post [closed]
- How can I resolve an error on WordPress after PHP update
- Remove a specific sitemap from Sitemap_index.xml
- Testing Plugin – Install plugin dependencies in testing enviroment