Trying to add function with pre_get_posts for plugin search [closed]

It’s hard to be sure without he error, but this part of code looks pretty weird:

if ( is_post_type_archive( epl_all_post_types() == 'true' ) ) {

is_post_type_archive gets one param and it should be post type or array of post types.

But in your code you pass a logical statement in there (so true or false).

So I can’t be 100% sure that this is the cause of error you’re getting, but most certainly this is the reason why this code won’t work correctly 😉

PS. Also… The epl_all_post_types function returns an array, so it doesn’t make much sense to compare it with true.