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
- List of all theme customizer control types?
- Modify previous and next text from pagination links
- Inject post (from specific category) between posts in Loop
- Shortcode putting html such as
- Calling a method from functions.php on a click of a button
- How do I create comment-reply-button using element not
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- How to check If Oembed is empty or not
- Making Quote Plugin more efficient
- Can I prevent the user from adding more than two levels deep of terms inside of a taxonomy metabox?
- Show css depending on activity type in BuddyPress activity-loop [closed]
- Fatal error: Uncaught Error: Call to undefined function test()
- Return a numerical function value in Customizer controls
- How can I get the values of my WordPress $wpdb query in Jquery?
- Css loads very slow [closed]
- Show when user is online/offline in real time on user_profile.php
- theme_root returning a truncated URI
- Call to undefined function get_userdata() in plugin
- Echo string and function?
- how to test for all children (including multilevel grand-childern) of page
- Add item to top of menu using a filter in functions.php
- Adding wrapper elements in the_date() like in the_title()?
- JSON REST API WordPress only showing first 10 categories
- Notify users only on post publish
- Get all categories post is not in
- PHP code for displaying WordPress posts in a static page not working
- Shortcode for Listing Users from Meta Value?
- Display css ONLY on most recent post of specific category?
- How can I use custom menus with a Bootstrap WordPress theme?
- Child Theme’s Read More Text
- call a string/function from database
- Get date function not working
- How to remove/hide collapse menu for user/subscriber?
- How to implement __() function in my theme’s php file?
- How do I edit the terms output args or array data?
- WP custom posts: filter results to custom taxonomy tag that corresponds to user meta field
- Get current user id in function php
- Proper way to remove html code on child theme
- Trying to add Custom Post Type to this functions.php command
- Apply function.php filter only if url not has /amp/
- Get custom field value from the function.php
- Non-blocking file_put_contents in function.php
- Having trouble creating two shortcodes, one for logged in user and one for visitors
- Link to index.php from home.php?
- How to escape echo for input tag?
- Including user data in “new user notification email”
- Display current user metadata on WordPress page
- Reload page with a different shortcode when a user selects from a dropdown
- Refresh page after login with litespeed cache
- Woocommerce Add custom “Add to cart button” in single page with tags
- remove_action() not working in page template – Genesis
- can’t see categories in appearance-menu-categories
- Modify php code to pass a page id as a parameter in order to create a breadcrumb
- Show custom default avatar instead of gravatar
- WordPress 2014 Theme – Featured Content with multiple tags?
- Is there a way to randomize and connect a background and header image?
- dynamically filter by category via sub-menu
- Get unique post in parent category
- ajax form function error
- Display custom meta box in my template file
- How to display the date under the post title?
- Simple Probléme in wordpress
- How to limit the number of posts in the wordpress loop in conjunction with the “download more” button?