I used WP Hooks Finder and there was no sign of it and my function isn't doing what I expected and it doesn't seem to be the code that's wrong.
Good to know it should be firing so I'll carry on trying though.
This conversation was closed a little prematurely. I never heard of WP Hooks Finder and don't know how it works. I use a different debugging method, one that allows me to set breakpoints in code. Breakpoints halt code execution at specific places set be you so you can examine values and logic to make sure everything works as expected.
The first thing I would do is install the Kint debugger. It's an easy debugger to learn. There are only 2 commands to remember d() and ddd(). The first command displays the content its target parameter and continues execution. ddd() does the same display but halts execution.
If you followed the frm_where_filter example in the knowledge base, then your callback function is receiving 2 parameters, $where and $args.
To know if your code is being called with Kint, immediately after the function declaration display these two parameters. Your code will look like this:
function my_callback_function( $where, $args) {
d($where);
ddd($args);
The rest of your function follows this. but will not execute because of the ddd(). If this hook is firing for you, you will see two drop down lists that display every data element in both parameters. This is how you know the hook is firing. You can also test boolean logic and equations with Kint.
Please login or Register to submit your answer