Check if comment was modified

You should be able to do this fairly simply by hooking to the edit_comment action and saving the modified date using update_comment_meta: add_action(‘edit_comment’, ‘my_comment_modified_date’, 10, 2); function my_comment_modified_date($comment_ID, $data) { update_comment_meta($comment_ID, ‘modified_date’, time()); }

Add classname comment template from functions.php

You should consider hooking into the comment_class() and post_class() filters, if your theme supports it. Using the comment_class filter: We can add the following filter: /** * Add a custom comment class, based on a given comment author’s user meta field. * * @see http://wordpress.stackexchange.com/a/170443/26350 */ add_filter( ‘comment_class’, function( $classes, $class, $comment_id, $post_id ) { … Read more

how to get the comment ID in the front end when the REPLY button is clicked?

Here are few ideas: It’s possible to inject custom HTML or data attributes via the comment_reply_link filter, but I think it would be better to keep it unobtrusive. One could try to get the comment parent value from the reply comment form: <input type=”hidden” name=”comment_parent” id=’comment_parent’ value=”0″ /> after it has been updated with the … Read more

How to add a privacy-checkbox in comment-template?

You can use the provided filters to do all that: //add your checkbox after the comment field add_filter( ‘comment_form_field_comment’, ‘my_comment_form_field_comment’ ); function my_comment_form_field_comment( $comment_field ) { return $comment_field.'<input type=”checkbox” name=”privacy” value=”privacy-key” class=”privacyBox” aria-req=”true”><p class=”pprivacy”>Hiermit akzeptiere ich die <a target=”blank” href=”http://wp.cloudstarter.de/?page_id=156″>Datenschutzbedingungen</a><p>’; } //javascript validation add_action(‘wp_footer’,’valdate_privacy_comment_javascript’); function valdate_privacy_comment_javascript(){ if (is_single() && comments_open()){ wp_enqueue_script(‘jquery’); ?> <script type=”text/javascript”> jQuery(document).ready(function($){ … Read more

Warning: call_user_func_array() expects parameter 1 to be a valid callback, func

I’m pretty sure that function tnc-remove_default_menu is not defined anywhere in your code. (You shouldn’t use – character in function name in PHP). So most probably there is a function called tnc_remove_default_menu, and you’ve misspelled it’s name in add_action/add_filter. If there is no such function anywhere in your code, then you should remove this filter/action … Read more