Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Notify user when a reply goes into moderation

@robin-w

Moderator

@clivesmith try this and you can add [mod-return] shortcode to your moderation page that gives a return to topic link

//add message if reply help in moderation
add_filter ('bbp_new_reply_redirect_to' , 'rew_pending_check', 30 , 3) ;

function rew_pending_check  ($reply_url, $redirect_to, $reply_id) {
	$status = get_post_status ($reply_id) ;
	$topic_id = bbp_get_reply_topic_id( $reply_id );
	if ($status == 'pending' ) {
		$reply_url = '/moderation/?moderation_pending='.$topic_id ;
	}
return $reply_url ;
}

add_shortcode ('mod-return' , 'mod_return' ) ;

function mod_return () {
	if (!empty($_REQUEST['moderation_pending'] )) {
	$topic_url         = get_permalink( $_REQUEST['moderation_pending'] );
	echo '<div class="mod-return"><a href= "'.$topic_url,'">Return to topic</a></div>';
	}	
}
Skip to toolbar