AnsPress_Category::after_new_question( integer $post_id, object $post )
Description #
Things to do after creating a question.
Parameters #
- $post_idinteger (Required) Questions ID.
- $postobject (Required) Question post object.
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' );
}
}
Expand full source code Collapse full source code View on GitHub: addons/free/category.php:412
Add your comment