I'm trying to pass a custom field value into a custom taxamony whenever I publish a post. Everything works fine except the meta value part. I can only pass strings. In the codex it says that wp_set_post_terms takes either string or array, tag or category. But can't I echo a meta value?
function add_author_taxonomy( $post_id ) {
global $wpdb;
if(!wp_is_post_revision($post_ID)) {
wp_set_post_terms( $post_id, echo get_post_meta($post_id, 'user_submit_customauthor', true) , 'author', true );
}
}
add_action('publish_page', 'add_author_taxonomy');
add_action('publish_post', 'add_author_taxonomy');