you can use wp_insert_term() to create the tag and then wp_set_object_terms() to set it as the custom post tag:
//get the tag
$tag = $_POST['ad_Tags'];
//create the tag
$term_id= wp_insert_term(
$tag, // the term
'post_tag', // the taxonomy
array('description'=> 'term description','slug' => 'term-slug')
);
//set the tag
wp_set_object_terms( $post_id, $term_id, 'post_tag' );
Related Posts:
- Any way to make custom taxonomy field searchable?
- Is ACF being a honey trap? [closed]
- Custom columns on edit-tags.php main page
- custom post type taxonomy “tag” archive : no post found
- Add custom taxonomy fields when creating a new taxonomy
- Exclude Specific Term from Search
- How to modify the query in taxonomy-custom.php to sort term archives by a custom meta field?
- Can I turn off write-in tags/taxonomies?
- Is it possible to use one slug for Multiple Taxonomies?
- Widget to display custom taxonomy tag cloud
- Post tags saving as both tag name & tag ID on post update when tags are displayed as checkboxes
- register_rest_field for custom taxonomy fields that are assosiated with custom post type
- Is it possible to sort the post based on a custom field?
- Custom taxonomy – custom sortable column
- How to display and use all existing tags at my write-post-at-frontend-panel?
- How to display submenus on page based on referring top-level parent?
- how to get title to custom tags page
- How do I display a tag cloud with both post tags AND a custom taxonomy?
- Can I turn off write-in tags/taxonomies?
- How get custom field from custom taxonomy?
- WordPress renames slug of tags used in multiple taxonomies?
- Allow only 1 instance of each term in each custom taxonomy
- How to add custom field to custom taxonomy in 4.4
- How do I make a custom taxomony appear like tags?
- how to search in custom fields & custom taxonomy for custom search
- Getting yoast title for custom taxonomy
- Outputting an array of term meta values in a custom WooCommerce tab?
- List the number of posts for each custom taxonomy and specific custom field value
- Solve product properties with custom taxonomies?
- Is it acceptable to build functionality into a theme built for a client? [closed]
- Hook to change Custom Tag Taxonomy Links?
- How to adjust code to refresh a dropdown box with tags that are active on filtered category listing
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Custom fields ‘for’ custom taxonomy?? Can someone explain why?
- Sorting Tags by Slug Value
- Print terms with taxonomy and metabox value
- Can I use a Custom Meta Value inside of ‘get_the_terms’?
- How to add contents of a custom field to a taxonomy term list?
- How can I hide admin columns showing extra custom taxonomy fields?
- Conditional display for custom fields/taxonomy
- How do I modify the “Insert Media” lightbox in the admin to only show media items from a category?
- I am trying to display information from a custom table from my wordpress users pages
- Extend & Search Native WordPress Image Galleries With Tags and Taxonomies?
- Save custom taxonomy data in different table not in wp_options for my own plugin
- How to create a dependent drop-down and options in dropdown must be manageable from admin panel
- How to filter a post in the Tag Cloud widget, using tags of a media library image attached to the post?
- How to separate posts in loop?
- Removing “s” from search with custom parameters
- How to fetch the data from Advanced Custom post when we search specific keyword or field name related to the post?
- How do I display a custom field from a custom taxonomy in single.php?
- WordPress implode & wp_insert_post question
- Problem with removing post tags programmatically
- Best structure for entering recipes in a WordPress theme?
- WP REST API – get custom taxonomies based on terms & filter
- Copy/clone/associate Custom field to Custom Taxonomy
- How to support fifteen thousand terms in WordPress?
- Changing input type from text to multi select dropdown – skill taxonomy
- Different Taxonomy Values for Each Post
- Filter through custom taxonomy with an array of taxonomy IDs
- What’s the best way to add taxonomy’s image in 2017?
- Displaying user selected custom tags/taxonomies on the front-end
- Why can’t I access Custom Taxonomy metadata?
- SQL / wp_update_post: change post custom field to CPT post taxonomy
- Featured Images for Tags?
- Filter by Custom Taxonomy AND Custom Field
- Can You Build Page Templates Without Extra Files
- Taxonomy or Custom Field
- making an index from custom taxonomies and tags of posts (not hierarchical taxonomy)
- Is there a way to nest taxonomies or custom fields deeper than one level below the post type?
- Set two terms for a post when they differ only by an accent
- How to use custom slug and custom templates for custom taxonomy?
- Custom field with terms from another taxonomy programmatically
- Convert post meta to custom taxonomy?
- Get tags name under custom taxonomy in wordpress
- Count tags for current post and save into custom meta field (and update it on post edit)
- Filter Tags for current users
- ACF – Get unique values of array
- Limit Tag Links in Post Content
- Remove Custom metabox from particular page template is used
- Add and Custom category for posts “PAGE”
- Change the Page Title of the Archive Page for Portfolio Tags
- Is it possible to sort the post based on a custom field?
- Reset custom taxonomy meta data after saving
- how to filter the data’s comparison operators (>= &
- How to add meta fields to custom taxonomy add/edit page?
- How to filter a taxonomy meta field to the ‘single_term_title’ filter hook
- Using wp_tag_cloud with only current post tag with special class
- sort Posts by custom user filed
- Display the first tag assigned to a post
- Register custom taxonomy from a Advenced custom field option page
- Display custom post taxonomies
- How can I show custom field according to taxonomy?
- How to randomise a custom taxonomy tag cloud
- Custom Fields link to other pages, not search
- Taxonomy Extra Meta [duplicate]
- How to get tags with custom taxonomy field?
- Primary Taxonomy for Post
- Advanced WordPress search form based on custom taxonomy and custom meta value
- More than one Hierarchical Taxonomy and SEO
- How much worse is querying custom fields compared to custom taxonomies, quantitatively