Did you try removing the IF statements and use save_post
hook instead of save_post_listing
to see if an IF statement is blocking the wp_set_post_terms
?
Also try wp_set_object_terms
instead of wp_set_post_terms
.
Furthermore, if you can make sure it has to do with the
if(get_post_meta($post_id, 'wpcf-proprty_online', true) == 'y')
statement, then this post_meta has not been updated before you are execusting this function. So why not update it within this function to make sure the value == ‘n’ or ‘y’.
update_post_meta( $post_id, 'wpcf-proprty_online', $_POST['the_name_of_yr_field'] );
Related Posts:
- Check for update vs new post on save_post action
- How to avoid infinite loop in save_post callback
- $update is always true in save_post
- Action hook ‘save_post’ triggered when deleting posts
- get post meta before it is updated (during SAVE_POST)
- save_post action firing before I publish / save the post
- save_post action only when creating a new post
- Check if value has changed on save_post
- Minimum Word Count Before A Post Can Be Made Pending Review
- update_post_meta() not working in save_post
- How do I save each option in a multiple select menu as it’s own meta_key + meta_value pair?
- Update post on save
- Post meta checkbox becomes unchecked occasionally
- Return code from save_post action?
- update_post_meta not working in save_post
- Get Post ID with insert/edit link
- How to manage saving custom field from Quick edit and Post Save using save_post action hook without colliding each other?
- Why save_post_$(custom_post_type) is fired even if I am not already saving a post?
- Set the value of custom field when post is published or updated
- pass error to admin_notices on “quick edit”/save_post action
- save_post requiere at least one uploaded file to be published
- Get $_POST & $_REQUEST values before adding/updating post
- How can I create a new user account while creating a new post, and then set that new user as the author of that new post?
- Validate post checking if child term is assigned
- Clear cache on post of one type when something happens to post of other type
- Why not fire the save_post event?
- Compare custom taxonomies of updated post (or new post) [Updated with progress]
- WordPress 4.9.8 doesn’t save if content has style=”
- Reset all transients on post or page save
- Using PODS data with save_post
- Cant’t delete my custom posts
- where does this $post_id come from?
- Update current WP post every 3 minutes [closed]
- Changing new post to “pending” on publish – but “Publish failed” – why?
- update_post_meta not working in foreach
- Save post in another table
- Strange bug on post/page save
- draft_to_pending action doesn’t seem to fire
- What action to use for when a post is saved / published, with a caveat
- Custom wp_editor doesn’t update post_content
- Save custom value to main content of post
- Check for page template on save_post hook
- Access NEW/UPDATED post values in save_post() callback function
- save button grayed out randomly
- Post editor doesn’t save embed media [closed]
- How to get a post meta value and pass that to update_option when a post is created or updated?
- WordPress save meta data : Displaying the word Array when selected
- Save current post using custom save button
- Connection Reset on post/page save
- Meta data not saved on save_post
- Insert/Update DB table when making new post or update older one
- Prevent Page/Post From Being Created based on Pages/Posts per User per Time Unit
- How to debug | Some times the “Save Draft” button seems to spin but does not actually save
- My custom title gets duplicated at every save or post update
- Use save_post to generate file on wordpress
- Detect, if post is saved manually or programmatically in save_post-hook
- Set custom messages for post update/save
- save_post + insert_post = infinite loop
- How to stop a user from updating the post date
- Why can’t I hook into save_posts after admin_init?
- How can I pass $post object to ‘save_post’ add_action?
- Returning ACF custom field from publish_post
- Post Auto Draft Issue
- publish_post conflicts with save_post
- WordPress as a web app – always auto-save post and meta data
- save_post_{CPT} not updating the ‘sticky_posts’ option
- Write automatic title at save_post (infinite loop)
- How to get updated data when save_post triggers?
- How to save post change url youtube link?
- Publish/Update post is changing image links from file url to post url
- How can I remove the kses filters when saving a specific post type ? (it breaks my JSON)
- 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
- Set default value field meta_Value [closed]
- Saving Custom Field Data before Publish
- Removing Uncategorized on post save if other category present?
- Conditional for autosave or auto draft?
- Custom Post Meta from custom metaboxes is randomly being deleted
- save_post action doesn’t passing post id to my function as argument
- Migrating from metaboxes to wp_editor()
- How check if a post is saved from backend or frontend?
- Change post author without using wp_update_post()
- Can’t add_action to ‘save_post’ and get it to fire
- Help using acf/save_post hook to connect to Untappd API and update_field [closed]
- Secure way to use name_save_pre?
- unable to save custom taxonomy terms in a custom-built metabox in wp-admin
- Is it possible to detect if a POST action is for a “Save Post” before the save_post action?
- Add action save post when create and publish
- Exclude URL’s from sanitize_html_classes
- Issue Saving Posts That Contain Shortcode
- save_post() on Menu Save
- wp_insert_post inside save_post adds wrong metadata to inserted post
- Custom post type meta fields missing on save_post_type
- generate random slug when adding taxonomy
- save_post affect creation and deletion
- Get Post ID in Admin Edit screen otherwise generate it?
- Meta Box – Javascript Datatable
- get categories the post was in and just been removed from
- Function that get ACF fields value before saving
- save post running twice and creating two database entries – how do I disable this?