User Submitted Posts Action
-
I’m trying to pass a custom value to a custom taxonomy. This piece of code works fine when I publish posts through the backend, but not with the plugin. When I remove the $my_tags however, and use a string instead, the plugin works too.
Why is this function not running with the plugin? Shouldn’t the plugin trigger publish_post?
function add_author_taxonomy( $post_id ) { global $wpdb; if(!wp_is_post_revision($post_id)) { $my_tags = get_post_meta($post_id, 'user_submit_customauthor', true); wp_set_post_terms( $post_id, $my_tags, 'author', true ); } } add_action('publish_page', 'add_author_taxonomy'); add_action('publish_post', 'add_author_taxonomy');
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘User Submitted Posts Action’ is closed to new replies.