I have found a solution without adding any other metaboxes. I haven’t thought about it but the import function in my plugin uses a nonce
so I just check if my nonce is set or not.
Here is my save_post_events
function:
add_action( 'save_post_events', 'wse_327066_example', 10, 3);
function wse_327066_example( $post_id, $post, $update ) {
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE || $post->post_status == 'trash' || !current_user_can( 'edit_posts' ) || isset( $_POST['_import_nonce'] ) )
return;
# Now I can do whatever I want with posts saved from the admin edit screen...
}
Related Posts:
- Update post_meta post_name with the post ID from wp_insert_post after user register
- Faster way to wp_insert_post & add_post_meta in bulk
- wordpress sanitize array?
- Is there a downside of using wp_defer_term_counting?
- wp_insert_post extremely slow on big table, direct query very fast
- wp_insert_post add meta_input
- tax_input not working wp_insert_post
- See error message from wp_insert_post function?
- Adding post thumbnail in programatically inserted post
- can’t edit post_modified in wp_insert_post (bug?)
- wp_insert_post incorrectly escapes HTML comments when they include tags
- What is considered the post’s creation date for wp_insert_post?
- Insert new term during new post creation
- wp_insert_post creates multiple pages
- wp_insert_post() getting slower the more posts
- How to allow data:image attribute in src tag during post insert?
- tax_input argument for wp_insert_post()
- How can I stop wp_update_post messing up HTML example code?
- How to insert custom function into wp_insert_post
- Is there a way to fire other functions from wp_insert_post
- wp_insert_posts Fatal error: Maximum function nesting level of ‘100’ reached, aborting!
- Programmatically add terms to custom post types
- Organizing uploaded media with wp_insert_post() and wp_handle_upload according to time parameter
- wp_insert_post not returning post ID? [closed]
- wp_insert_post to schedule a post – but nothing happens?
- post_date_gmt and post_date [duplicate]
- Get data from wp_editor()
- wp_insert post doesn’t work
- Replace string with post_name on sidebar
- Visual Editor – Colorize Shortcodes
- Efficient way to save a lot of meta data
- How to update post parent?
- post_status => publish not working
- Contact Form 7 to featured image
- Conditionally set post_content in wp_insert_post
- How to use wp_insert_post to update meta box?
- wp_insert_post -> post_content not showing
- wp_insert_post bulk import 500 server error
- after wp_insert_post need to get the post id
- Could not get post ID from wp_insert_post()
- Creating New Page with WP_INSERT_POST Issue
- Set default Custom Post Meta Value
- Inserting post, thumnail and custom fields with wp_insert_post
- add_menu_page Callback Function: Skip page content?
- using wp_insert_post inside of custom meta box
- wp_insert_post or wp_set_post_terms do not save taxonomy, but wp_set_post_terms does
- Making sure wp term relationships records are unique
- update_post_meta, xml parser
- Pre insert data when adding new custom post fire a json error
- wp_insert_post if page doesn’t exist under current page
- When User Meta amended update Title and Slug of Post programatically
- keep wp_insert_post from adding duplicates
- Combining wp_insert_post() and update_post_meta()
- Programmatically create a post once a day
- wp_insert_post custom type and custom taxonomies
- Where to call wp_insert_user() and wp_insert_post() from?
- wp_insert_post at same time as saving post results in 502 Bad Gateway
- wp_insert_post alternatives for faster process
- WP-CLI –meta-input error: Warning: Invalid argument supplied for foreach()
- tax_input in wp_insert_post partly not working
- $user_id = wp_insert_user( $userdata ) Not working no errors
- $wpdb->insert() does not insert fields
- Insert multiple posts as parent of the first
- duplicate entries in database while using save_post or wp_insert_post
- wp_insert_post Only creates draft
- Save the Post ID from wp_insert_post($post); into a text file?
- wp_insert_post removes information when updating
- Bug in wp_insert_post script and form, probably something simple I am not seeing
- Can wp_insert_post_data filter be used to save custom field data?
- Setting Post Date Returning “Notice: A non well formed numeric value encountered”
- wp_insert_post creating duplicate post with Safari
- “transition_post_status” action creating two post with wp_insert_post
- wp_insert_post fails at return statement (nothing is returned to the caller, the error displayed is: The Link You Followed Has Expired)
- wp_insert_post always returns 0 on one site, extensive testing done, can’t get to the bottom
- XML FOLDER – wp_insert_post – how to assign XML variables to post
- Cannot insert HTML content even removing kses filters
- Updating failed message when a wp_insert_post function is hooked to save_post hook
- get_page_by_title() not working as expected
- On save_post need to wp_insert_post and save partent post id to child post and child post id to parent post
- wp_insert_post inside save_post adds wrong metadata to inserted post
- Insert Multiple Posts from JSON Results
- How can I automatically add a post with Latin characters?
- How to insert post from external php file?
- How to Create Content Remotely
- Get original post ID after wp_insert_post
- Generate slug and meta data if meta field is empty
- Bulk insert posts is really slow and skips entries
- Insert post programmatically and decide to tweet or not to tweet
- Changing wp_insert_post() location
- wp_insert_post questions
- wp_insert_post does not insert string with apostrophes correctly
- Setting a featured image while creating the post
- Issues with post_content when using wp_insert_post
- I need to dynamic insert post containing javascript from my other website?
- wp_insert_post and title not utf8 inserts with empty title?
- wp_insert_post memory consumption
- wordpress apply filters and is singular()
- Cant get front end form to post to wordpress
- The reverse of wp_insert_post
- Set post_parent from URL params in post-new.php