How to get post_id when new or edit posts?
-
I am trying to make a unique ACF field using this
https://support.advancedcustomfields.com/forums/topic/accept-only-unique-values/add_filter('acf/validate_value/name=numero', 'unique_numero_field', 10, 4);
function unique_numero_field($valid, $value, $field, $input) { return $_POST['post_id']; }
How to get the post_id here?
When setting the dynamic values for title as post_id – the post id is showing in the form title.
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘How to get post_id when new or edit posts?’ is closed to new replies.