I noticed there was a 302 redirect in my network tab while saving. Save_post was being triggered twice, once from
Inside my call, I simply included:
$referrer = wp_get_referer();
if (strpos($referrer, 'http:') !== false) {
error_log("not the right referrer, aborting");
return;
}
Issue solved.
Related Posts:
- Using save_post to replace the post’s title
- Prevent post from being published if custom fields not filled
- Why won’t my metabox data save?
- Custom post type save_post action not firing
- Submitting posts from the front end – sanitizing data
- flush_rewrite_rules on save_post Does Not Work on First Post Save
- Is there an easy way to AJAX-ify saving of post?
- Custom field values get deleted
- Change 2 fields in the post depending on the 3rd field before save
- Unable to save or update postmeta for custom post type via action using save_post hook
- update_post_meta() whenever custom post type is updated
- Trigger “unsaved changes” dialog for custom post meta changes
- Frontend posting – everything saves other than checkboxes?
- Custom Post Custom Taxonomy Data Not Saving in Edit Screen
- Is it possible to create a post using a metabox?
- Confusion regarding Nonce & using it in Custom Columns for Saving Checkbox Value to Post Meta
- How to get updated data when save_post triggers?
- How can I set taxonomy programmatically
- Custom Taxonomy terms aren’t getting referenced or saved in Quick Edit or Bulk Edit, only on Single product page?
- Troubles with acf/save_post and WP_Query
- CPT Validation to not show “Post updated.”
- save_post custom post type ? $_POST not working?
- Custom Post Meta from custom metaboxes is randomly being deleted
- Mutiple Select only POSTing 1 value
- Custom Post Type Metadata Not Saving
- detect when a custom post is cretaed for the first time
- What do the numbers mean at the end of add_action(‘save_post’)…?
- How check if a post is saved from backend or frontend?
- How to detect that the save_post hook is calling the callback associated to the current edit post page only
- How to prevent meta data from being edited in a post?
- Catch and display error on save_post action
- Custom Post Type Meta Box Text Input Field Won’t Save When Blank
- Urgent – WordPress keeps creating posts
- How to check for duplicate record before saving a Custom Post Type
- Custom post types saved as basic post
- Save_post acf data not updating category of post type
- Post meta is not accessible within save_post hook
- Custom post type meta fields missing on save_post_type
- How to save post_status using action save_post?
- How to stop post status from reverting to Published?
- save_post affect creation and deletion
- Link two different post using there post_id in post meta
- Custom meta box data not saving
- How to implement custom post type’s users
- How to hook save-post function to use taxonomy term in post-slug?
- Metabox is not saving
- Generate slug and meta data if meta field is empty
- Problem with ‘save_post’ hook not running
- Not Able to Display Metabox Saved Checkbox and Selected option After Save/ Update
- Function that get ACF fields value before saving
- How to use wp_set_object_terms depending on page ID?
- How to automatically update ACF field value every year?
- Generate Post Title From ACF Fields on Custom Post Type
- looping though custom post types and only return results in a given taxonomy
- display custom taxonomies limited to custom post type?
- Allow front end users to add data to a custom post type
- custom fields cannt be seen with version 3.1
- Displaying custom post types as a gallery
- Get_the_terms restrict output
- Populate a custom field dropdown with post titles by author
- Can I query posts by taxonomy conditionally based on post type?
- Shortcode leaves no space for other elements?
- Can anyone clarify difference between archive-{posttype}.php, type-{posttype} and date.php?
- Conflict between wp_list_pages and get_posts – list pages not displaying
- User-submitted reviews of different custom post types
- How to make a pulldown menu display custom meta terms in a theme?
- After creating custom post type, URL to custom posts are invalid
- Custom post type index (maybe using get_template_part)
- Custom post type menu
- Listing all slugs?
- How can I merge this function(s) that inserts terms to a custom taxonomy with this other that adds a custom taxonomy filter?
- What would be a proper name for a custom post type created for static content?
- How to include category name/id in wp_query for retrieving “custom post type” from a particular category?
- Custom fields not saving in newest WordPress 3.0.1
- How can I display a drop-down select of Post Names
- Which file/template is in charge of taxonomies for custom post types?
- Implementing Pillar Posts; Long Posts yet with Some Page-Like Handling?
- get_post_types – exclude multiple post types by name
- Address as a content type post
- CPT Columns doesn’t show categories
- Custom post type loop with custom category filtering
- Hide Status Option From WordPress Publish Metabox and Rename Published on:
- Check if user has comment on current post
- How to conditionally add Custom Post Type to Front Page
- Role capabilities issue
- Assigning a category to a custom post type in WordPress
- Insert Custom Post Types
- How to inherit field value from parent post into in child / sub post
- Create field of Custom Post Types
- Dynamically insert code to custom post type loop
- how to show records that don’t have custom meta value
- How can I add a shortcode to query Custom Post Type with ACF in WordPress?
- Custom Post Types not queried in Custom Taxonomy archives or Native archives
- Show current custom taxonomy
- Template for custom post type when taxonomy is in the URL
- finding and using post type fields in WordPress
- One Custom post type 404’s others don’t
- sortable columns for multiple custom post types not working
- Why WordPress is picking archive.php instead of page.php?
- I need to add a filter to prepend the term ‘National – ‘ to the post title if the post is tagged to multiple states