• Hi, I love your plugin but for a client I need to make the research by myself for better relevant results.

    So first of all, I disabled the plugin but I need it on the back office.

    Can I keep the plugin activated and just disabled the ACF better search (with a filter or something ) just before do my query ?

    Thanks

    • This topic was modified 1 year, 4 months ago by deviensla.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    Hi @deviensla,

    Thank you for your message.

    You can use a WordPress filter called acfbs_is_available, which returns true or false, depending on whether the search is to be run or not.

    Here is an example code:

    add_filter( 'acfbs_is_available', function ( $status ) {
    	if ( is_admin() ) {
    		return false;
    	}
    	return $status;
    } );

    Best,
    Mateusz

    Thread Starter deviensla

    (@deviensla)

    Thanks for your reply.
    It works, but as I do a query in ajax so is_admin() return true ..

    I added a test for checking if I use admin-ajax.php :

    
    
    function detecting_is_front_ajax()
    {
    $test_url = basename($_SERVER['REQUEST_URI']);
    return str_contains($test_url, 'admin-ajax.php');
    }
    Plugin Author Mateusz Gbiorczyk

    (@mateuszgbiorczyk)

    @deviensla The is_admin() condition was an example to show you how this filter works. You should create your own condition yourself.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Disabled for specific search’ is closed to new replies.