Hi,
I hope someone here can help me clarify my codes.
You see I have modified the bbpress moderation plugin since I am not getting any response from it's author.
Okay, here's the problem. I am making the pending post view-able only to the author, admin and moderators. Right now the bbpress moderation pending posts "always display option" is view-able to all. I have added some codes to it to achieve my goal. And when I added the global $post and call the post_author, I can't make it work.
Below is my code:
function query($bbp) {
global $current_user, $post;
if (get_option(self::TD . 'always_display')) {
$post_author = wp_get_current_user();
if ( (current_user_can('moderate')) || (current_user_can('level_0') && $post_author->ID == $post->post_author) ) {
add_filter('posts_where', array($this, 'posts_where'));
} else{
}
}
else
{
// remove_filter('posts_where', array($this, 'posts_where'));
}
return $bbp;
}
I am hoping for your kind response. Thanks.
Best regards,
Mariz