Quantcast
Channel: WordPress › Support » Forum: Hacks - Recent Topics
Viewing all articles
Browse latest Browse all 8245

mariz_p on "pending topics must be viewable to the author only - bbpress moderation plugin"

$
0
0

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


Viewing all articles
Browse latest Browse all 8245

Trending Articles