Tags::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/tags/tags.php

	public function after_new_question( $post_id, $post ) {
		$values = anspress()->get_form( 'question' )->get_values();

		if ( isset( $values['tags'], $values['tags']['value'] ) ) {
			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