How to update_comment_meta from checkbox in comments_custom_column?
How to update_comment_meta from checkbox in comments_custom_column?
How to update_comment_meta from checkbox in comments_custom_column?
Check if your theme has its own comment template by going to [yoursite.com]/wp-admin/theme-editor.php (when logged in as an administrator). Then look at the right column and try to find comments.php file. If it’s there, it controls the way your comments are displayed, so you can manually delete hyperlinks and dates from it. If you can’t … Read more
The solution was to add a priority number to the comment_post action that was saving my rating value, as shown below: function save_comment_meta_data( $comment_id ) { if ( ( isset( $_POST[‘rating’] ) ) && ( $_POST[‘rating’] != ”) ) { $rating = wp_filter_nohtml_kses($_POST[‘rating’]); add_comment_meta( $comment_id, ‘rating’, $rating ); } } add_action( ‘comment_post’, ‘save_comment_meta_data’, 5 ); … Read more
The comments popup page contains a loop of the comments, which can be checked by an is comments popup() conditional, that returns either true or false. However, i don’t see this feature being used in modern development. This might be the only place containing a direct loop of comments. The $wp_query itself does not contain … Read more
Make the input names array elements: <input type=”checkbox” name=”condition[]” PHP will convert that on the fly to a real array before you get access to the values.
If you need to show the averages in the content, you need to pre-calculate them (before showing the comments). My approach would be having a custom meta in the post with the calculated averages and modify those metas every time a new comment (rating) is saved. Something like add_action(“comment_post”, “wpse16733_updateAVGs”); function wpse16733_updateAVGs($comment_ID, $approved){ if ($approved){ … Read more
Run the loop in advance and populate an array, which in turn you include in the $result afterward. <?php // Create an empty array $comlistall = array(); foreach ( $comments as $comment ){ $comlistall[] = $comment; // <= Populate the array with the comments in the loop }; $rtitlez = get_the_title(); $rimgz = get_the_post_thumbnail_url(get_the_ID(), ‘full’); … Read more