Conditionally process comments while ignoring replies

Simply check if the comment has a parent before decrementing points. Reading the Codex entry for the get_comment() function, you’ll note that in the manner you use the function you will be returned an object containing keys that correspond to the column names of the wp_comments table. Viewing the wp_comments scehma, note that there is … Read more

Trash a post, send associated comments into the trash bin (change status)

There’s an action called trashed_post_comments that runs right after the comments are set to post-trashed status. You could hook into that: add_action( ‘trashed_post_comments’, ‘wpse134528_really_trash_comments’ ); function wpse134528_really_trash_comments( $post_id ) { $args = array( ‘post_id’ => $post_id, ‘status’ => ‘post-trashed’, ); $comments = get_comments( $args ); foreach( $comments as $comment ) { wp_trash_comment( $comment->comment_id ); } … Read more

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