It should be running, the acf ajax function works for whether or not your logged in.
There is one of two things not going on.
1) Your filter is not being added
2) There is a PHP or JS error that happens that causes it break
For the first, have you tried adding
echo 'here'; die; just before the filter is added to make sure that line in your code is called.
For the second, since it’s an ajax function you won’t be able to tell unless you turn WP error reporting on and log the errors to a file. The code you added `echo ‘<pre>’;
print_r( $args );
` will just cause a php error that causes the ajax to break.
See debugging. https://codex.wordpress.org/Debugging_in_WordPress
define('WP_DEBUG', true); define('WP_DEBUG_LOG', true);
and then look in the file to see if any php error happen. For JS errors, you’ll need to look at your console and see if any JS errors are reported.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!