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

Remove “at” string from wordpress comment date

Most likely, the ‘at’ is coming from the value of $comment->comment_date. If that is the case, and since we have to do with string, you could pass it from str_replace first, in order to remove the ‘ at’, like: function my_change_comment_date_format( $date, $date_format, $comment ) { return date( ‘d M Y’, strtotime( str_replace(” at”, “”, … Read more

How to get last comments but not from admin (or other specific user role/capability)?

Yay! We got filters! Wrapping the result of the $wpdb comments query right into a filter callback (and a plugin) is the nice way of handling comments. /* Plugin Name: »Kaisers« Comments without admin comments */ ! defined( ‘ABSPATH’ ) AND exit; add_filter( ‘comments_array’, ‘wpse_61072_comments_without_admin’, 20, 2 ); function wpse_61072_comments_without_admin( $comments, $post_id ) { foreach … Read more

adding a text message beside the comment submit button

You should not edit the WordPress core files! If you have comment_id_fields() in your comments template, like this: <p class=”form-submit”> <input name=”submit” type=”submit” id=”<?php echo esc_attr( $args[‘id_submit’] ); ?>” value=”<?php echo esc_attr( $args[‘label_submit’] ); ?>” /> <?php comment_id_fields( $post_id ); ?> </p> you might use: add_filter(“comment_id_fields”,”my_submit_comment_message”); function my_submit_comment_message($result){ return $result.” <span>(your message will only be … Read more

How can I show comments in random order?

Never actually had a need for this but you will need to use the WP_Comment_Query function. There is this handy comments query generator online to customize this query easily. But wait, it doesn’t allow you to select a random order. No worries just add or replace the orderby parameter: ‘orderby’ => ‘rand’ This should return … Read more

Change WordPress comments url / word

In your functions.php add ( there are other rules relating to comment pages you can see them all with Rewrite Rules Inspector plugin, this one just covers the case you mention ) add_rewrite_rule ( ‘(.?.+?)/customname-([0-9]{1,})/?$’, ‘index.php?pagename=$matches[1]&cpage=$matches[2]’, ‘top’ ); you’ll also need to find in your theme ( possibly in your function.php ) where the comments … Read more

customize comment form

This code will allow you to customize the comment field labels and will move the comment form below the fields. Add the code to your functions.php or to a plugin. To change the labels, modify the Name CUSTOMIZED, Email CUSTOMIZED, and Website CUSTOMIZED, and Comment * CUSTOMIZED text. /** * Customize comment form default fields. … Read more

How do I change parameters without changing the core

If you scroll further down the comment-template.php file, you’ll notice that the next available filter you can use is comment_form_defaults. With this filter you can change the default comment form configuration. add_filter( ‘comment_form_defaults’, ‘filter_comment_form_defaults’ ); function filter_comment_form_defaults( $defaults ) { $defaults[‘comment_field’] = sprintf( ‘<p class=”comment-form-comment”>%s %s</p>’, sprintf( ‘<label for=”comment”>%s</label>’, _x( ‘Please leave a comment…’, ‘Comment … Read more

deneme bonusu veren sitelerbahis siteleripulibet girişdeneme bonusutürkçe altyazılı pornocanlı bahis casinocanlı bahis casino siteleriOnwin Güncel Girişholiganbetholiganbet girişholiganbet güncel girişnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnewsnews