error: invalid_taxonomy
-
I had setup wordpress with my theme.
I add taxonomy with below content in funtions.php
function reg_location(){ $args = array( 'label' => '??a ?i?m', 'hierarchical' => true, 'show_ui' => true, 'query_var' => true, 'public' => true, 'rewrite' => true, 'rewrite' => array( 'slug' => 'lam-viec' ), ); register_taxonomy('noi-lam-viec', array('post','resume'),$args); } add_action('init', 'reg_location');
everything ok but I can’t set wp_set_object_terms ?
$my_post = array( 'post_type' =>'resume', 'post_title' => $ResumeTitle, 'post_content' => $ResumeDescription, 'post_status' => 'publish', 'post_author' => $current_user->ID, 'tags_input' => $jobTags, 'post_name' => $slug, //'tax_input' => array( 'noi-lam-viec' => array( $mainlocation ) ) ); if ($_POST['joblocation']>0) $locationID[] = $_POST['joblocation']; $tax = 'noi-lam-viec'; $demo = wp_set_object_terms($post_id, $locationID, $tax);
I received error when debug:
WP_Error Object ( [errors] => Array ( [invalid_taxonomy] => Array ( [0] => Invalid Taxonomy ) ) [error_data] => Array ( ) )
anyone can help me !
Thanks
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘error: invalid_taxonomy’ is closed to new replies.