How to set custom post terms for new post in P2?
-
Hi, everybody!
I’m using wordpress 3.0 beta1 and P2 v1.1.3.
I tried add custom post terms for new post in P2.
I has a custom taxonomy called “letter”, I add code below in p2/inc/ajax.php(line 176, before “echo $post_id ? $post_id : ‘0’;”):wp_set_post_terms( $post_id, ‘A,B’, ‘letter’);
this didn’t work.
but wp_set_post_tags($post_id,’A,B’) is work well.
wp_set_post_tags() function in wp-includes/post.php, here it’s code.function wp_set_post_tags( $post_id = 0, $tags = ”, $append = false ) {
return wp_set_post_terms( $post_id, $tags, ‘post_tag’, $append);
}So, I creat a new function:
function wp_set_post_letters( $post_id = 0, $tags = ”, $append = false ) {
return wp_set_post_terms( $post_id, $tags, ‘letter’, $append);
}and I use wp_set_post_letters($post_id,’A,B’), it is still didn’t work.
Forgive me my bad english, Anyone has a solution for this?
- The topic ‘How to set custom post terms for new post in P2?’ is closed to new replies.