acf backend error handling

Lets walk though the acf/validate_value filter logically… I’m assuming both of your code snippets are the same snippet, and you are not executing them together (as @Buttered_Toast pointed out). Here is your code (see my added comments) code below is assuming your dfg_service_type acf field is a number field… /** * @param mixed $valid Whether … Read more

Revision featured image

The featured image is saved as postmeta, and by default, postmeta is not stored in revisions. This means that if anyone removes the featured image and saves (updates) their post, that postmeta is removed and not associated to the post anywhere. If you need to modify this behavior for the future, you can programmatically enable … Read more

Conditional delete metadata does not works

Try applying these and your code might work: Looking at the expressions $type_of_running == ‘manually_run’ and $type_of_running == ‘planned_run’, where you’re expecting get_post_meta() to return a single meta value, you should then set the 3rd parameter to true: // Set the 3rd param to true to get a single meta value. $type_of_running = get_post_meta($post_id, ‘spusteni_dotazovani’, … Read more