wordpress admin ajax trash_comment

The way you’re adding parameters to the url isn’t working. The ajax request is designed to prevent parameter insertion like this. I recommend you kick off another ajax request to handle this process rather than trying to hook into the existing process in this way. For example, you can kick off your modal window after … Read more

Can’t get ID of post that relates to the comment

comment_post hook pass to attached functions 3 parameters. The fourth parameter of add_action() indicates to how many parameters the attached function will be able to access. add_action( ‘comment_post’, ‘save_chbox_in_db’, 10, 3 ); function save_chbox_in_db( $comment_ID, $comment_approved, $commentdata ) { $post_id = (int)$commentdata[‘comment_post_ID’]; // // other code // }

Ajax Comment Upvotes – Votes don’t always register

Please try this and inform me what you got in the console. and sure console.log the type add_action( ‘wp_ajax_comment_meta_update_vote’, ‘comment_meta_update_vote’ ); function comment_meta_update_vote( ) { check_ajax_referer( ‘upvote_nonce’ ); $comment_id = $_POST[‘comment_id’]; $vote_score = get_comment_meta($comment_id , ‘vote’, true); $vote_score++; $updated = update_comment_meta($comment_id , ‘vote’, $vote_score ); if($updated){ $msg = ‘success’; }else{ $msg = ‘failed’; } $response … Read more

How pass args to wp_list_comments callback?

After looking at the wp_list_comments() and Walker_Comment sources I would assume the callback is what the Walker uses to render single comments. And the callback recieves three parameters $comment, $args, $depth when the Walker calls it. Based on this, I assume you should be able to just push custom key-value pairs to your $args array … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)