I often write WordPress actions/hooks and then write smaller functions that go in my functions.php file to support and reduce clutter in the action code. Most of the time, they work well, but occasionally I will write one and find that some WordPress functions from both WordPress and ACF don’t return values or just don’t work correctly but when moved to the main code of the action they do work. Is there anything special I should be doing or setting up or importing to make my code when working out side of a hook/action to get access to everything I need for my function to run right ?
[ad_2]