I’m using a theme which uses meta boxes for its settings page. I’m getting a warning at this settings page.
Warning: Missing argument 2 for Comment_control::set_default_comment_status() in .../wp-content/plugins/comment-control/comment-control.php on line 62
I’ve fixed it making the second argument optional.
function set_default_comment_status( $post_type, $post = null ){
$screen = get_current_screen();
// only mess with new posts that support comments
if( ! $post || ! isset( $this->options['allow_comments_on'][$post_type] ) || $screen->action != 'add' || $screen->base != 'post' || ! post_type_supports( $post_type, 'comments' ) )
return;
$post->comment_status = $this->options['allow_comments_on'][$screen->id] ? 'open' : 'closed';
$post->ping_status = $this->options['allow_pings_on'][$screen->id] ? 'open' : 'closed';
}
Greats from Germany
LeisureLarry
I’m looking forward to using this plugin (I just installed it but haven’t tested it yet). Wanted to ask if there was a way to delete the 150,000 comments from spammers that are already there (yeah, didn’t know my theme had comments enabled for all images)
Thanks,
Hirum
Just noticed an enormous amount of spam on one of the images which was attached to a post. Seeing there’s no option to disable comments on attached media, I quickly hacked a plugin myself to do that (and only that) only to realize such a plugin probably already exists.
And indeed yours fits the bill and is certainly more flexible, but the option ‘disable comments on media files/ attachments’ would be a welcome addition to ‘inherit from parent post’. Any chance that could be added, so I could dump my quick hack? ??
]]>Used it to turn off comments on medial library. Thanks!! The spam is gone!
Force attachments to always inherit their comment status from their parent post.
(so if comments are closed on a post, then comments will also be closed on its attachments)
I have not tried it on regular post and pages.
]]>