Reason action hook won’t work with update_post_meta from frontend form? Alternative?
The context of your code that fails isn’t entirely clear, but it’s failing because get_the_ID() won’t return a post ID when run on the init hook, because the main query hasn’t been executed yet. If you have a look at the Action Reference, wp is the earliest action where you can access the current query’s … Read more