I think you have used wrong tax_input parameter value for wp_insert_post() function it should be array like this
array( 'taxonomy_name' => array( 'term', 'term2', 'term3' ) )
as shown in the following code
$my_post = array(
'post_title' => $title,
'post_content' => $content,
'post_status' => 'publish',
'post_type' => 'faenas',
'tax_input' => array( 'faenas_combenef_category' => array( $location ) )
);
Related Posts:
- Advanced search form with filters for custom taxonomies and custom fields
- How to Add Custom Fields to a Custom Post Type?
- Get terms by taxonomy AND post_type
- Get Posts by Custom Post Type ,Taxonomy, and Term
- Get The Post Type A Taxonomy Is Attached To
- Display current taxonomy term when inside custom post type
- Get term slug of current post
- display post count in archive page that have relation with another taxonomy term
- Return multiples taxonomies with wp_get_object_terms
- Custom taxonomy terms hierarchical navigation
- How to display custom taxonomy term specific post?
- Display Posts that fit a certain criteria on Category pages
- How to list posts by terms
- Excluded Custom Taxonomy Term Posts Displaying in loop
- How to order taxonomy terms by most recent post?
- Display Custom Field or Custom Taxonomy in front page /post/product
- How to associate custom taxonomy terms with custom post type?
- get_queried_object not work in taxonomy page
- wp_insert_post deleting previous post custom meta
- Change the term based on the value of a $variable using wp_update_post in submitting a form
- get_the_terms child terms for current post/custom post only
- PHP Warning with Custom Fields
- I want to create a metabox under custom taxonomy
- Get all posts for custom taxonomy term
- posts_per_page is not working by term
- Adding a Section for Visitors
- Dropwdown: Get taxonomy terms from posts that share preselected terms from 3 other taxonomies
- Custom Post Type / Taxonomy / Term – what template to use to avoid 404-page?
- Query posts by multiple custom fields
- Pages of my taxonomy terms are showing all posts
- Display title of all custom posts from same taxonomy term on a custom post template
- wordpress does not see the correct custom taxonomy hierarchy
- Custom taxonomy template for custom fields loop [closed]
- Add active class to foundation 6 tabs while looping categories
- Saving Child Terms on front end not setting parent
- How to show terms used only for particular custom post type. Filter creation perpose
- Get category list & taxonomy list from different post type using post id?
- How to get all posts related to a taxonomy?
- Create Inclusions and exclusions
- Custom taxonomy- only output relevant terms
- order taxonomy alphabetical
- What’s the most efficient way to get two queries based on an if statement?
- Filter Term By Parent Term – Custom Post Type
- Filter By Term Not Working – Custom Post Type
- Display all Custom taxonomy terms and their relevant custom posts
- WordPress get all post with like in terms [duplicate]
- Get posts of an specific term of a custom taxonomy
- WordPress add taxonomies/terms list as a menu in archive page
- Need some suggestion/help with custom post types project
- Best way to use Category & Custom Fields?
- Decrement term in for each
- Best way to group posts based on custom post type terms
- Hide Custom Taxonomy title if not associated with another Custom Taxomony
- How to pass taxonomy terms to WP_Query along with $args?
- Custom Post Status & Taxonomies
- Get list of CPT posts in *current* post’s taxonomy term
- Fetch posts list from fist CPT taxonomy term and list under 2. CPT
- Prevent repetitive terms in get_the_term_list
- How to List CPTs Under One Tax Term
- predefined custom field on registration page
- How to retrieve the permalink for a specific (custom) term?
- Exclude Custom Post Type from shared Custom Taxonomy
- Show Custom Post Type taxonomy term that matches custom field
- Remove Custom Taxonomy Slug only without removing Custom post type slug in permalinks
- Get a list of categories ids
- custom taxonomies are not showing up in get_taxonomies
- Storing/querying custom date data
- Get term_id for each instance of custom taxonomy
- Order by custom field attribute
- List a custom taxonomy’s terms, with links, on the taxonomy page
- taxonomy terms array not working
- install.php Custom Taxonomy Term not being added to custom post
- Taxonomy Query of Custom Post Displays Archive Instead of Posts
- Advanced search form with filters for custom taxonomies and custom fields
- Custom post type and custom taxonomy archive inaccessible
- get_the_term_list() wanting to loop through the returned values
- List custom taxonomy terms
- show 10 most recent custom post types excluding the one(s) from specific custom taxonomy
- How to Get The Taxonomy Term in Custom Post Type Loop Inside a Wp Query
- Custom Post type as Taxonomy
- Display associated taxonomy child name on single CPT page
- How to change order of custom post types. I want Featured post to come first
- How to manage a bookstore
- Get all terms assigned to a post from different taxonomies
- Issue On Listing Woocommerce Parent Tag List
- pre_get_posts causes Custom Posts appear under ‘Pages’ menu
- I want to understand plugin implementation of custom posts / taxonomies / metaboxes
- Get term link of shared taxonomy between multiple post types
- How to use wp_set_object_terms depending on page ID?
- Custom Sort Order for Custom Post Type Taxonomy
- Taxonomy Archive URL + Template
- WP_Query not using relation key as expected and not producing any results
- Creating subpages for each custom post type
- Display posts from Custom Post Type, group by term, arrange term groups and arrange items within groups by menu order
- Category display using conditions
- Is it possible to get_terms by taxonomy AND post_type?
- How to list custom taxonomy terms without the hyperlinks?
- edit index custom post type page with elementor or other
- Is there a way to edit non-custom term attributes?
- Can’t retrieve custom post type taxonomy term to custom post type editor