By default, the search will be done through all the available forums. Using the filter ‘gdpos_diallowed_forums_ids_list‘ you can control list of forums that will be excluded.

This filter provides 1 argument only.

Arguments

  • $list: empty array as a placeholder

Important

There are a few things you need to know:

  • This filter is fired when the form is generated to populated forum selection and when the search query is created.
  • If you have forum hierarchy, you need to list exact ids for forums and subforums you want to exclude.
  • You can use conditional functions inside the filter function – for instance, to get a user ID and build a list of forums for individual users.
  • This filter will not be used if you use a gdpos_allowed_forums_ids_list filter.

Example

This example will not allow a search through forums with ID’s listed in line 3.

add_filter('gdpos_disallowed_forums_ids_list', 'custom__gdpos_forums_ids_list');
function custom__gdpos_forums_ids_list($list) {
    return array(58041, 7137, 7138, 7169, 23087, 50267);
}
0
0
368
Rate this reference

You are not allowed to rate this post.

Comments

Leave a Reply