Get comment number by date range?
Get comment number by date range?
Get comment number by date range?
Is there a Function so that the author of the comment can delete his own comment?
After further research I found some relevant functions. Keep in mind it’s probably better to separate these into different functions, and if your WordPress theme gives you any trouble, check this out. // disable url field function disable_comment_url($fields) { if(isset($fields[‘url’])) unset($fields[‘url’]); return $fields; } add_filter(‘comment_form_default_fields’, ‘disable_comment_url’); // disable email field function disable_comment_email($fields) { if(isset($fields[’email’])) unset($fields[’email’]); … Read more
Something like this should be pretty universally functional across themes, as long as they use something like the normal comment form code. if ( ! current_user_can( $capability_required_for_commenting ) ) { add_filter(‘comments_open’, ‘disable_comments’, 20, 2); add_action(‘comment_form_comments_closed’, ‘display_no_comment_permissions_message’ ); } And then somewhere you’ll want to define: function disable_comments() { return false; } function display_no_comment_permissions_message() { ?> … Read more
You have to create a schedule event. It is a best practice to assign this schedule event to the activation of the plugin, and it should be cleared when the plugin is deactivated. /** * Plugin activation * – create schedule event */ function enlsbv7_activation() { if ( ! wp_next_scheduled( ‘enlsbv7_event’ ) ) { wp_schedule_event( … Read more
Error 403 when posting comments to a custom post type from a different page
Do comments have revisions like posts and pages? If so, how would you access those revisions? No, WordPress only provides revisions for posts. The “History” link on the admin/comments page does not show any editing/changing/updating of the comment, whether done by the admin or the original commenter. This is actually added by Akismet and not … Read more
When we post an empty anonymous reply, we get the following errors: The part of BBPress that’s responsible for handling this, is the bbp_new_reply_handler() function, in the file /bbpress/includes/replies/functions.php. It contains these lines that are of interest to us: // User is anonymous if ( bbp_is_anonymous() ) { // Filter anonymous data $anonymous_data = bbp_filter_anonymous_post_data(); … Read more
Somewhere in your theme template is a call to the_comments_pagination(). If you would look at the source code, you could find the declaration of that function: function the_comments_pagination( $args = array() ) { echo get_the_comments_pagination( $args ); } There are two things to note here: This function is passing its call through to another function. … Read more
In case you want to remove comment from home only, Then follow these steps. Click on edit of homepage. Click on Screen Options and the top right. From there check Discussion. After this below text editor you will see new option box for discussion. Deselect Allow comments from there Let me know if you face … Read more