comments_open() and php segmentation fault.
-
Hi,
I’m using this code in a mu-plugin to stop not logged users to comment posts. I’m using mu-plugin because I need to have control over this setting in a multi user environment (WPMU).<?php function disable_network_anonymous_comments() { if (is_user_logged_in()) { return true; }else{ return false; } } add_filter('comments_open', 'disable_network_anonymous_comments', 20, 2);
The problem is that in this way a logged user can always send a comment (also if the blog owner disabled them for a particular post).
So I tried to add comments_open() in this way:
<?php function disable_network_anonymous_comments() { if (is_user_logged_in() && comments_open()) { return true; }else{ return false; } } add_filter('comments_open', 'disable_network_anonymous_comments', 20, 2);
But this causes a php-fpm segmentation fault (!!!) And here I really do not know how to solve.
Any idea? Thank you!!!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘comments_open() and php segmentation fault.’ is closed to new replies.