WordPress.org

Forums

User Submitted Posts
[resolved] User Submitted Posts Action (2 posts)

  1. Draphoelix
    Member
    Posted 1 year ago #

    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/

  2. Jeff Starr
    Member
    Plugin Author

    Posted 1 year ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • User Submitted Posts
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.