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

Description #

Things to do after creating a question.

Parameters #

  • $post_id
    integer (Required) Questions ID.
  • $post
    object (Required) Question post object.

Changelog #

VersionDescription
1.0Introduced.

Source #

File: addons/free/category.php

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

		if ( isset( $values['category']['value'] ) ) {
			wp_set_post_terms( $post_id, $values['category']['value'], 'question_category' );
		}
	}

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