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]
- How to remove the tag cloud from custom taxonomy admin page?
- 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?
- Get value in custom field with taxonomy [closed]
- Is it possible to use one slug for Multiple Taxonomies?
- Widget to display custom taxonomy tag cloud
- Remove Category description textarea
- Custom metabox for menu administration page?
- Custom Fields and performance
- 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
- Non-hierarchical custom taxonomy using checkboxes on edit-screen -> saving issue
- 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?
- Automatically assign taxonomy term if custom meta value exists
- 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?
- Storing data into custom taxonomies VS post custom fields (post meta)
- 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]
- Make tag cloud links consistent
- 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
- Metabox to list/store a certain type of post tag
- $wpdb query a post type within a specific taxonomy term while ordering posts by custom meta value?
- Custom fields to taxonomy
- 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
- Displaying the post count of all custom taxonomy terms in a list format
- Extra Meta Data for WordPress Multisite Taxonomy
- Taxonomy or Custom Field
- Automatically tag posts based on user-defined words [closed]
- 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?
- Create multiple taxonomies with custom fields values on the fly when creating new posts
- 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)
- Create new Taxonomy, add extra fields, register terms AND extra fields values?
- Filter Tags for current users
- Dropdown (with onChange) with custom taxonomies
- ACF – Get unique values of array
- Limit Tag Links in Post Content
- Remove Custom metabox from particular page template is used
- ACF Custom field not showing in Timber Taxonomy page
- Pre_get_post custom taxonomy combined with custom fields?
- Adding a checkbox field to a (custom) taxonomy
- 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
- Get Posts by tag from a custom taxonomy
- Display the first tag assigned to a post
- Register custom taxonomy from a Advenced custom field option page
- Display custom post taxonomies
- Avoiding stripping of HTML in Custom Taxonomy Meta Field
- add custom fields in custom taxonomy meta box in wordpress-3.5.2
- Use custom field as tag slug
- How can I show custom field according to taxonomy?
- Transfer taxonomy to custom field
- How to randomise a custom taxonomy tag cloud
- Custom Fields link to other pages, not search
- How do i change the tags and taxonomies
- 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
- Group custom taxonomies based on tags contained in their posts
- How do I create a term for every value of a post meta?
- How to show to show post list under the specific category name using jetengine query?