How to make applyFilters function return false via functions.php

Question

So I have a following code inside the plugin:

if( window.wp.hooks.applyFilters( 'filtername', true, $(this) ) ) {
//do something
}

how can I make above statement always false without editing plugin files but using functions.php instead? I’m not sure if I understand applyfilters correctly but I’ve tried:

function filtername() {
    return false;
}
add_filter( 'filtername', 'filtername', 10, 3 );

but it didn’t work. What would be propper way to do it? Can someone please explain.

0
Greg Viv 2 months 0 Answers 7 views 0

Leave an answer