Support » Plugin: User Submitted Posts » User Submitted Posts Action

  • Resolved Draphoelix

    (@draphoelix)


    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');

    http://wordpress.org/plugins/user-submitted-posts/

Viewing 1 replies (of 1 total)
  • Plugin Author Jeff Starr

    (@specialk)

    The plugin will only trigger publish_post if the settings instruct it to do so. Check that “Auto Publish” option is set to auto-publish and it should work.

Viewing 1 replies (of 1 total)
  • The topic ‘User Submitted Posts Action’ is closed to new replies.