Title: Found one bug
Last modified: August 22, 2016

---

# Found one bug

 *  [sovabarmak](https://wordpress.org/support/users/sovabarmak/)
 * (@sovabarmak)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/found-one-bug/)
 * At first hank you for your plugin.))
 * When using your plugin it is impossible to make moderate simple comments. Few
   hours of exploring your plugin and I found code wich do this problem.
    in includes/
   ansppress-form.php (line 793)
 * this
 *     ```
       public function pre_comment_approved($approved , $commentdata){
       		if($approved =='1' ){
       			$post_type = get_post_type( $commentdata->comment_post_ID );
   
       			if ($post_type == 'question') {
       				// set updated meta for sorting purpose
       				update_post_meta($commentdata->comment_post_ID, ANSPRESS_UPDATED_META, current_time( 'mysql' ));
   
       				// add participant
       				//ap_add_parti($commentdata->comment_post_ID, $commentdata->user_ID, 'comment');
   
       			}elseif($post_type == 'answer'){
       				$post_id = wp_get_post_parent_id($commentdata->comment_post_ID);
       				// set updated meta for sorting purpose
       				update_post_meta($post_id, ANSPRESS_UPDATED_META, current_time( 'mysql' ));
       				// add participant only
       				//ap_add_parti($post_id, $commentdata->user_ID, 'comment');
       			}
       		}
       	}
       ```
   
 * need change to this
 *     ```
       public function pre_comment_approved($approved , $commentdata){
       		if($approved =='1' ){
       			$post_type = get_post_type( $commentdata->comment_post_ID );
   
       			if ($post_type == 'question') {
       				// set updated meta for sorting purpose
       				update_post_meta($commentdata->comment_post_ID, ANSPRESS_UPDATED_META, current_time( 'mysql' ));
   
       				// add participant
       				//ap_add_parti($commentdata->comment_post_ID, $commentdata->user_ID, 'comment');
   
       			}elseif($post_type == 'answer'){
       				$post_id = wp_get_post_parent_id($commentdata->comment_post_ID);
       				// set updated meta for sorting purpose
       				update_post_meta($post_id, ANSPRESS_UPDATED_META, current_time( 'mysql' ));
       				// add participant only
       				//ap_add_parti($post_id, $commentdata->user_ID, 'comment');
       			}
       		}else{
       			return $approved;
       		}
       	}
       ```
   
 * [https://wordpress.org/plugins/anspress-question-answer/](https://wordpress.org/plugins/anspress-question-answer/)

Viewing 1 replies (of 1 total)

 *  Plugin Author [Rahul Aryan](https://wordpress.org/support/users/nerdaryan/)
 * (@nerdaryan)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/found-one-bug/#post-5475412)
 * Thank you for letting us know, please feel free to join us in github: [https://github.com/open-wp/anspress](https://github.com/open-wp/anspress)

Viewing 1 replies (of 1 total)

The topic ‘Found one bug’ is closed to new replies.

 * ![](https://ps.w.org/anspress-question-answer/assets/icon-256x256.png?rev=2432843)
 * [AnsPress - Question and answer](https://wordpress.org/plugins/anspress-question-answer/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/anspress-question-answer/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/anspress-question-answer/)
 * [Active Topics](https://wordpress.org/support/plugin/anspress-question-answer/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/anspress-question-answer/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/anspress-question-answer/reviews/)

## Tags

 * [Comments](https://wordpress.org/support/topic-tag/comments/)

 * 1 reply
 * 2 participants
 * Last reply from: [Rahul Aryan](https://wordpress.org/support/users/nerdaryan/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/found-one-bug/#post-5475412)
 * Status: not a support question