How to Delete Old Comments by Date?
You could easily do this using mysql: DELETE FROM wp_comments WHERE comment_date < DATE_ADD(CURDATE(), INTERVAL -6 MONTH)
You could easily do this using mysql: DELETE FROM wp_comments WHERE comment_date < DATE_ADD(CURDATE(), INTERVAL -6 MONTH)
FB – Comment Moderation Tool bug or error in the code?
The tags that are allowed in comments are stored in the $allowedtags global variable. You can try adding elements to that list (the key is the tag name, the value is an array of allowed attributes). If you have problems with the timing you can play with the CUSTOM_TAGS global variable.
You have to set the value of $_POST[‘comment_post_ID’] to the post id of the page: <input type=”hidden” name=”comment_post_ID” value=”10″ /> Then set the action of the form element to /wp-comments-post.php, filter ‘comment_post_redirect’ and send the visitor back to page where the comment/review was written. Here is an example, written as plugin: <?php /* Plugin Name: … Read more
If you look in wp-includes/default-filters.php you’ll see all of the functions each comment is run through before it’s output. I’d guess it’s the last one, wpautop, which adds p tags in place of line breaks: add_filter( ‘comment_text’, ‘wptexturize’ ); add_filter( ‘comment_text’, ‘convert_chars’ ); add_filter( ‘comment_text’, ‘make_clickable’, 9 ); add_filter( ‘comment_text’, ‘force_balance_tags’, 25 ); add_filter( ‘comment_text’, … Read more
I suggest adding a snippet to the theme file where the comments form is loaded that checks to make sure there is a logged in user and then, if that user a Subscriber, then show the comments form to them. The examples below use the Twenty Sixteen theme: In comments.php: // First, get the current … Read more
This is indeed the default behavior of WordPress. The comments always stay on the same comment page, so if you show the last comment page first, that last comment page will not always have the “full” number of comments. The advantage of keeping a comment always on the same comment page is that the URL … Read more
You can circumvent the check for empty comments easily by adding the uploaded image as HTML to the comment text: add_action( ‘pre_comment_on_post’, ‘allow_empty_comment_text’ ); function allow_empty_comment_text( $text=”” ) { if ( ! isset ( $_POST[‘comment’] ) or ” === trim( $_POST[‘comment’] ) ) { $img = ‘/* Process uploaded image here, create an <img> tag. … Read more
Per default wp_list_comments() calls the class Walker_Comment. Its method start_el() calls edit_comment_link() and here we find a filter for your question: It is called ‘edit_comment_link’ and it passes two variables, the link text and the comment ID, which we can use. The URLs to mark a comment as spam or to delete it are: wp-admin/comment.php?c=1&action=cdc&dt=spam … Read more
add this code into your plugin file to register activation hook // register activation hook register_activation_hook( __FILE__, ‘my_rating_plugin_activation’ ); now create a function and add your table creation code into function my_rating_plugin_activation() { global $wpdb, $rating_table_name; if($wpdb->get_var(“SHOW TABLES LIKE \”$rating_table_name\””) != $rating_table_name) { $wpdb->query(“CREATE TABLE IF NOT EXISTS $rating_table_name ( rating_id int(11) NOT NULL AUTO_INCREMENT, … Read more