Custom action on comment post
You can use wp_insert_comment action, which is triggered on every comment insertion.
You can use wp_insert_comment action, which is triggered on every comment insertion.
Ok, so this is what I’ve done. If anybody has a better idea I will leave the answer open for a few hours and choose it! <?php if($comments) : ?> <ol> <?php foreach($comments as $comment) : ?> <li id=”comment-<?php comment_ID(); ?>”> <?php if ($comment->comment_approved == ‘0’) : ?> <p>Your comment is awaiting approval</p> <?php endif; … Read more
Your format looks a bit off to me. I’d try it more like this: <?php $fields = array( ‘author’ => ‘<p><label for=”author”><span class=”req”>* </span>’ . __( ‘Name’ ) . ‘</label><input id=”author” name=”author” type=”text” value=”‘ . esc_attr( $commenter[‘comment_author’] ) . ‘” size=”30″‘ . $aria_req . ‘ /></p>’, ’email’ => ‘<p><label for=”email”><span class=”req”>* </span>’ . __( ‘Email’ … Read more
I added remove_action( ‘wp_head’, ‘feed_links’, 2 ); in functions.php file. and added in the header.php. This fulfilled my purpose.
Those are “subscribe” checkboxes. View source and you can see them and the rest of the content. <p class=”comment-subscription-form”> <input type=”checkbox” name=”subscribe_comments” id=”subscribe_comments” value=”subscribe” style=”width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;” /> <label class=”subscribe-label” id=”subscribe-label” for=”subscribe_comments”>Notify me of follow-up comments by email.</label></p> <p class=”comment-subscription-form”> <input type=”checkbox” name=”subscribe_blog” id=”subscribe_blog” value=”subscribe” style=”width: auto; -moz-appearance: checkbox; -webkit-appearance: checkbox;” /> … Read more
Hook into wp_insert_post, check if it is an auto-draft for a page, and set the comment_status to closed: add_action( ‘wp_insert_post’, ‘t5_disable_default_comments_on_pages’, 10, 2 ); function t5_disable_default_comments_on_pages( $post_ID, $post ) { remove_filter( current_filter(), __FUNCTION__ ); if ( ‘auto-draft’ !== $post->post_status or ‘page’ !== $post->post_type ) return; $post->comment_status=”closed”; wp_update_post( $post ); }
Subscribe To Comments Reloaded allows subscribing without commenting. It uses a link instead of a button, though. Screen shot: It shouldn’t be too hard to customize.
First you should KNOW all different posts with comments: global $wpdb; $SelectSQL = “SELECT DISTINCT `comment_post_ID` FROM {$wpdb->comments} LIMIT 0, 15”; $Rows = $wpdb->get_results($SelectSQL); then for each of these posts get the latest comment: foreach($Rows as $row): $comment = get_comments(array(‘post_id’=>$row->comment_post_ID, ‘number’=>1, ‘status’=>’appprove’)); $comment = $comment[0]; … and continue with the display of comment, hope you … Read more
Take a look at the arguments you’re passing to get_comments() and compare them to the documentation on the WordPress Codex. Your example – $args = array( ‘include’ => $postids, ‘meta_query’ => array( array( ‘key’ => ‘viewed_status’, ‘value’ => ‘unseen’ ) ), ‘count’ => true ); The codex example – $defaults = array( ‘author_email’ => ”, … Read more
I found a way to hijack the comment before it’s attached to its post in the DB. Using the snippet below you can attach every comment to your dummy post. Just change COMMENT_ID to the ID of your dummy post. No hacking of core needed! <?php add_filter(‘preprocess_comment’, ‘akt_hijack_comment’); function akt_hijack_comment($comment) { define(‘AKT_REDIRECT_URL’, $comment[‘comment_post_ID’]); $comment[‘comment_post_ID’] = … Read more