wpfts_pre_set_file_search (Filter)

The wpfts_pre_set_file_search filter in WP Fast Total Search is designed to modify the WP_Query object before file search settings are applied. However, based on the code and comments, this filter is deprecated and may be removed in the future. It is not currently used for any significant logic in the plugin.

Arguments

  • &$wpq (object): The WP_Query object.
  • $display_attachments (int): A flag indicating whether to display attachments in search results (deprecated parameter).

Return Value

  • The filter should not return any value, as the WP_Query object is passed by reference.

Important Notes

  • This filter is deprecated and should not be used. Instead, use other available filters such as wpfts_pre_get_posts or filters related to specific search settings.
  • The documentation should clearly indicate that the filter is deprecated and suggest alternative options.
add_filter('wpfts_pre_set_file_search', 'my_wpfts_pre_set_file_search', 10, 2);
 
function my_wpfts_pre_set_file_search(&$wpq, $display_attachments)
{
	// Your logic (using this filter is not recommended).
}