I’m fairly new to working with websites and coding in general, so this may be a fairly obvious question to some folks. I’m trying to use the remove_filter() WordPress function to unhook a filter that one of my plugins uses, that isn’t working well with my database collation method. I’ve come up with something I think should work, but am unsure about whether the remove filter function is actually working because I see no difference in the way the plugin behaves before and after I implement my solution. So I thought I’d reach out and see if anyone here can see any obvious gaps in my understanding that would prevent this from working.
The filter I’m trying to unhook appears this way in the plugin init.php file:
add_filter( 'relevanssi_remove_punctuation', 'remove_accents', 9 );
Therefore, I’ve gone ahead and added the following line of code in my child theme function.php file :
remove_filter( 'relevanssi_remove_punctuation', 'remove_accents', 9 );
Is this the correct way to implement the remove filter function and the best spot to put the line of code in my site files?
If this looks good, it really helps me troubleshoot the issue, because it means that there’s a gap in my understanding about how the plugin works rather than how this function works.
Leave an answer