Notifications
Clear all

Can't get beyond forum page

7 Posts
2 Users
1 Reactions
531 Views
Posts: 5
Topic starter
(@arcaswebdesign)
Active Member
Joined: 6 months ago

Just in case this is of use to anyone else, Maciej (the developer of Permalink Manager Pro) supplied the following code to fix the issue:

function wpforo_adjust_query( $query, $old_query, $uri_parts, $pm_query, $content_type, $element_object ) {
	if ( ! function_exists( 'wpforo_get_option' ) || ! function_exists( 'WPF' ) ) {
		return $query;
	}

	$boards = WPF()->board->get_boards_pageids();
	$boards[] = wpforo_get_option( 'wpforo_pageid', 0 );

	if ( ! empty( $element_object->ID ) ) {
		$detected_page_id = $element_object->ID;
	} else if ( ! empty( $old_query['page_id'] ) ) {
		$detected_page_id = $old_query['page_id'];
	}

	if ( ! empty( $boards ) && ! empty( $detected_page_id ) && in_array( $detected_page_id, $boards ) ) {
		$query['do_not_redirect'] = 1;
	}

	return $query;
}
add_filter( 'permalink_manager_filter_query', 'wpforo_adjust_query', 5, 6 );

He also advised that he'd integrate this fix into the next release so this snippet may not be needed in the future but thought it would be useful to post here anyway.

Reply
Page 2 / 2