WordPress comment processing . Default unapproved comments detection before posting
WordPress comment processing . Default unapproved comments detection before posting
WordPress comment processing . Default unapproved comments detection before posting
It will be a three step process. You can use comment_form_logged_in_after (for logged in users) and/or comment_form_after_fields (for non-logged in users) actions to add your custom fields. Save the values as comment meta using update_comment_meta function hooked into comment_post action. Get the values using get_comment_meta. EDIT: 25-05-2022 Try this.. /* * This will add the … Read more
I needed to use new WP_Comment_Query and set my $args to show only this post, with the meta attached. Hope this helps someone! <?php comment_form(); if (have_comments()) : ?> <div class=”container”> <div class=”btn-group flex”> <button type=”button” onclick=”window.location.href=”https://wordpress.stackexchange.com/questions/406158/<?php echo the_permalink();?>/?cmeta=ALL””>SHOW ALL</button> <button type=”button” onclick=”window.location.href=”<?php echo the_permalink();?>/?cmeta=BUY””>BUY</button> <button type=”button” onclick=”window.location.href=”<?php echo the_permalink();?>/?cmeta=SELL””>SELL</button> <button type=”button” onclick=”window.location.href=”<?php echo the_permalink();?>/?cmeta=TRADE””>TRADE</button> … Read more
Your comment replies do not work because you’re using a custom comment rendering callback function named better_comments, and this function hardcodes the classes IDs and other attributes rather than calling functions such as comment_ID. I strongly suggest abandoning this function, and instead opting for the default commenting from a default theme. This way you can … Read more
How to auto-generate names for guest users who leave comments?
You don’t have the comment reply Javascript being enqueued. Add this to your header, just before the wp_head() call: if ( is_singular() && get_option( ‘thread_comments’ ) ) wp_enqueue_script( ‘comment-reply’ );
You can add it directly through your functions.php, unfortunately this is not documented very well at all. You want to hook into add_comment_meta using add_action, to look at this further refer to line 500-ish of comment.php. It looks like this function add_comment_meta($comment_id, $meta_key, $meta_value, $unique = false) { return add_metadata(‘comment’, $comment_id, $meta_key, $meta_value, $unique); }
Check out the code for the IntenseDebate comments system and make sure where the Comments variable is initiated it looks like this __(“Comments”, “your-theme”), A double under-score denotes it to be translated. “Comments” is the interface element and “your-theme” is the theme translation initiator that should be in you functions.php theme file // Make theme … Read more
Okay, just looking through this code quickly, it looks like the problem may be that the getImgID() function is echoing rather than returning its output. This function is called from within another function, guan_getImgID_inserter(), that is hooked into the comment_text filter hook. Anything that filters comment_text (or any filter hook, for that matter), should be … Read more
you can disable comments for individual pages from dashboard – pages – all pages: click quick-edit below the page name, then untick allow comments – that should remove the comment form from the page.