add_action('wpcf7_mail_sent', function ($cf7) {
$submission = WPCF7_Submission::get_instance();
$data = $submission->get_posted_data();
if( empty($data['_wpcf7_container_post']) )
return;
$post_id = (int) $data['_wpcf7_container_post'];
wp_remove_object_terms( $post_id, 'available', 'category');
wp_set_object_terms( $post_id, 'booked', 'category');
});
Related Posts:
- exclude multiple terms using get_terms() function
- Counting number of posts in a category and its sub categories and displaying result using shortcode
- Allow authors to post only in categories they create in WordPress
- Add custom field to attachments in a specific category
- How to Populate the list of custom post type categories
- Php string not working in WordPress Functions.php [duplicate]
- Problems with function on function.php
- Use template for posts with a particular category grandparent
- Check if Product is in a Specific Category in Functions.php
- Woocommerce – remove product from category
- get current product name in functions.php
- get post based on category chosen in drop down – The ajax method
- Swapping wp_dropdown_categories function with wp_category_checklist
- Pass Category Name, Description and Photo into variables to pass to jQuery
- How to pick the default selected value in wordpress dropdown?
- Get page that displays all children of taxonomy parent
- Dilemma of Populating all the categories in a drop down list
- Edit the_category (); for a hierarchical display
- Displaying posts based on category
- How to get current post category details inside “loop”?
- Show all tags within a category?
- Post not populating for custom post type based on category selection
- Dropdown category field inside repeatable metabox
- Display Visual Composer shortcode if a post belongs in specific categories
- Get parent category name when only child category is applied to a product
- Notice: Undefined variable
- Hide a specific category title from displaying on site
- Populate Posts based on category selected using AJAX that means without page refresh
- All categories options or All categories not Populating
- Customizing the output of the archive and category widget without altering the original behavior of the widget
- PHP get_category() function redeclared
- Get category id for a custom category and display it in a class
- Trying to see if page is category or single and displaying title with appropriate heading tag
- Displaying categories
- How to insert the first letter in uppercase [closed]
- Hide child of parent categories already hidden with “get_terms_args” – Woocommerce
- Exclude a category ID from the following function
- How to deprecate a function used in a plugin?
- How to manually fix the WordPress gallery code using PHP in functions.php?
- Displaying post per day
- Rewriting search and pagination base
- Copyright info change in Theme Child PHP
- Why is PHP Cookie via plugin only set when logged in as Admin and not regular users? and other questions
- Insert After Second Paragraph Without Tag?
- User Defined order on get_categories?
- Is the regular ajax request method safe or I should use admin-ajax.php?
- Using wp_get_image_editor in a standalone script
- page template for attachement page?
- PHP Deprecated: WP_RSSjb has a deprecated constructor
- Set WordPress Default Template
- Showing content from one page on another
- How to insert a single row to WP database table?
- Get date numerical and separate?
- How to check if a meta value has already been assigned to any user?
- Unique icons next to each WordPress menu item
- Way to add captions to gallery images by code
- How to make container class in PHP
- How do I check or test a WordPress Auto Year Change Script?
- How to hide the author box of a specific user?
- Add date before entry title in Twenty Twelve
- WordPress theme showing blank page
- Defining multiple categories for showing latest posts
- Finding and removing duplicates within WP Arrays
- The additional fee for the COD payment method not visible in the front-end
- PHP identify duplicate words in a text string against a list of words
- How to add and subtract user meta values after post meta update
- Multiple AJAX handler functions conflict in functions.php
- Adding custom field to product category and show it to shop/category shop page
- Theme editing “post thumbnail” help
- Restrict File Type Uploads by User on Wordress via functions.php
- How to Request a User to Register on Landing at a Site, Then Automatically Delete the Users Password on Logout?
- AJAX Returning Way Too Many Posts
- Showing Subcategory’s Name and Link Instead of Parent Category’s
- Select area and checkbox data is not saving?
- How to modify this function to exclude also the post belonging to a specific category?
- Suppress errors when using global function
- WordPress Importer Call to undefined function set_time_limit()
- Display terms on product page with shotrcode
- Stop breadcrumb function retrieving custom post type template name
- Slug not being updated using wp_insert_post
- The search doesn’t work properly
- Add attribute to featured image with filter (wp_get_attachment_image_attributes)
- get second ID from array
- How do I get a function to work in single.php
- WordPress different custom tag being displayed in on tag list
- Get category name of current post (CPT UI)
- Replace block content with an array
- Add text below WooCommerce short description if metabox value is true
- ACF number less than comparison not working
- Count post with tags within one category?
- Unable to logout correctly after wp-login file was modified
- Woocomerce custom add to cart button edit functionality [closed]
- Put ACF function output code the_terms
- How to access admin menu labels and links on front-end?
- If you want to implement custom field-wise search functionality in the WordPress admin area
- How can we upload custom page files?
- How to get default variation ID (woocommerce)
- wordpress media library description column
- Function exclusion for a plugin
- I want change custom title in custom wordpress php page