Comment Approve – Add custom function when comment is approved

Sadly there are no hooks or filters that you could use in edit-comments.php. You’d have to build your own admin page with a custom button and use wp_set_comment_status( $comment, ‘approve’ ); to approve comment and do whatever you need to do… EDIT: I was wrong – there’s the wp_set_comment_status action inside wp_set_comment_status function https://wpseek.com/function/wp_set_comment_status/ do_action( … Read more

add category to posts with tag wordpress

This is just an example to get all posts in the category transportation with the tag car : $args = array( ‘post_type’=>’post’, ‘tax_query’ => array( ‘relation’ => ‘AND’, array( ‘taxonomy’ => ‘category’, ‘field’ => ‘slug’, ‘terms’ => array( ‘transportation’ ), ), array( ‘taxonomy’ => ‘tag’, ‘field’ => ‘slug’, ‘terms’ => array( ‘car’ ), ‘operator’ => … Read more

Understanding custom php that reads from WP MYSQL

Have you looked at the server log files (MySQL and PHP)? It could be several things: A MySQL permission issue on the db and/or table Table is named differently than stated in your code MySQL and/or WordPress are using older versions that don’t support certain syntax