AnsPress_Tag::after_new_question( integer $post_id, object $post )

Description #

Things to do after creating a question.

Parameters #

  • $post_id
    integer (Required) Post ID.
  • $post
    object (Required) Post object.

Changelog #

VersionDescription
1.0Introduced.

Source #

File: addons/free/tag.php

	public static function after_new_question( $post_id, $post ) {
		$values = anspress()->get_form( 'question' )->get_values();
		if ( isset( $values['tags'] ) ) {
			wp_set_object_terms( $post_id, $values['tags']['value'], 'question_tag' );
		}
	}

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Add your comment