wp_set_post_terms
-
I am trying to set terms from meta boxes i have added using add_meta_box(). I’m trying to accomplish something very similar to this post: http://wordpress.stackexchange.com/questions/23917/wp-set-post-terms-example
However I keep running in to the same error when using wp_set_post_terms() and wp_set_object_terms():
Catchable fatal error: Object of class stdClass could not be converted to string in /wp-includes/taxonomy.php on line 2569I’ve been trying to figure this out for a while. My custom fields look like this after getting all the taxonomies for a particular post:
foreach($taxonomies as $taxonomy) { $tax = $taxonomy->name; ?> <label><?php echo $taxonomy->label['name']; ?></label> <p> <input type="text" name="_ajwiv_vidlib_terms[<?php $tax ?>]" value=""/> </p> <?php } ?>
And I am trying to set the terms like this:
if(isset($_POST['_ajwiv_vidlib_terms'])) { foreach($_POST['_ajwiv_vidlib_terms'] as $tax => $term) { wp_set_post_terms( $post_id, $terms, $tax ); }
Any help you could provide would be greatly appreciated.
-AJ
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_set_post_terms’ is closed to new replies.