@beh333 Me too never resolved this issue, I just did custom jQuery form validation on $("#post").submit();
Hi John thank you for your help,
The semicolon was missing only here in my question, I didn’t miss it in the actual code.
And it is still not working.
I just want to know that I understand that correctly – If I put the above code in function.php, everytime that I try to save post with acf fields in it I should get error message saying “is that working?” and the post shouldn’t be saved, right?
Right now it’s not working, I put the following code in functions.php, and the posts saves successfully.
add_filter('acf/validate_value', 'my_acf_validate_value', 10, 4);
function my_acf_validate_value( $valid, $value, $field, $input ){
return "is that working?";
}
EDIT:
Just try to run this in order to check if my site is even response to the code
add_action('acf/validate_save_post', 'my_acf_validate_value', 10, 0);
function my_acf_validate_value( ){
die();
}
And the posts still saves as usual..
I don’t know if that’s related but I registered the fields manually via php..
I didn’t understand the first one.
What’s the different between the code you wrote and mine?
And is, it in in function.php
The PHP error should cause it to fail but in my case it doesn’t fail, it saves the post successfully even thought I want to return some message.
Hi,
I var-dumped it and can’t see any “menu_order” there.
The output:
array(9) { ["Üretim Şekli:"]=> array(19) { ["key"]=> string(19) "field_53bd963ef0b34" ["label"]=> string(15) "Üretim Şekli:" ["name"]=> string(15) "Üretim Şekli:" ["_name"]=> string(15) "Üretim Şekli:" ["type"]=> string(4) "text" ["order_no"]=> int(0) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(25) "acf-field-Üretim Şekli:" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(3) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" ["value"]=> string(0) "" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(12) "Açık tarla" } ["Erkencilik:"]=> array(19) { ["key"]=> string(19) "field_53bd97c6f0b3b" ["label"]=> string(11) "Erkencilik:" ["name"]=> string(11) "Erkencilik:" ["_name"]=> string(11) "Erkencilik:" ["type"]=> string(4) "text" ["order_no"]=> int(1) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(21) "acf-field-Erkencilik:" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(3) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" ["value"]=> string(0) "" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(7) "Erkenci" } ["Bitki Yapısı:"]=> array(19) { ["key"]=> string(19) "field_53bd9650f0b35" ["label"]=> string(15) "Bitki Yapısı:" ["name"]=> string(15) "Bitki Yapısı:" ["_name"]=> string(15) "Bitki Yapısı:" ["type"]=> string(4) "text" ["order_no"]=> int(2) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(25) "acf-field-Bitki Yapısı:" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(3) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" ["value"]=> string(0) "" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(8) "Güçlü" } ["Meyve Uzunluğu:"]=> array(19) { ["key"]=> string(19) "field_53bd965cf0b36" ["label"]=> string(16) "Meyve Uzunluğu:" ["name"]=> string(16) "Meyve Uzunluğu:" ["_name"]=> string(16) "Meyve Uzunluğu:" ["type"]=> string(4) "text" ["order_no"]=> int(3) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(26) "acf-field-Meyve Uzunluğu:" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(3) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" ["value"]=> string(0) "" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(10) "18 - 22 cm" } ["Meyve Rengi:"]=> array(19) { ["key"]=> string(19) "field_53bd9667f0b37" ["label"]=> string(12) "Meyve Rengi:" ["name"]=> string(12) "Meyve Rengi:" ["_name"]=> string(12) "Meyve Rengi:" ["type"]=> string(4) "text" ["order_no"]=> int(4) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(22) "acf-field-Meyve Rengi:" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(3) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" ["value"]=> string(0) "" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(0) "" } ["Meyve Tipi:"]=> array(19) { ["key"]=> string(19) "field_53bd9671f0b38" ["label"]=> string(11) "Meyve Tipi:" ["name"]=> string(11) "Meyve Tipi:" ["_name"]=> string(11) "Meyve Tipi:" ["type"]=> string(4) "text" ["order_no"]=> int(5) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(21) "acf-field-Meyve Tipi:" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(3) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" ["value"]=> string(0) "" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(24) "Sivri Biber (Demre tipi)" } ["Hastalık Dayanımları (Rezistanslar):"]=> array(19) { ["key"]=> string(19) "field_53bd967cf0b39" ["label"]=> string(40) "Hastalık Dayanımları (Rezistanslar): " ["name"]=> string(39) "Hastalık Dayanımları (Rezistanslar):" ["_name"]=> string(39) "Hastalık Dayanımları (Rezistanslar):" ["type"]=> string(4) "text" ["order_no"]=> int(7) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(49) "acf-field-Hastalık Dayanımları (Rezistanslar):" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(2) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(8) "IR: TSWV" } [""]=> array(18) { ["key"]=> string(0) "" ["label"]=> string(0) "" ["name"]=> string(0) "" ["_name"]=> string(0) "" ["type"]=> string(4) "text" ["order_no"]=> int(1) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(10) "acf-field-" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["allorany"]=> string(3) "all" ["rules"]=> int(0) } ["default_value"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["value"]=> bool(false) } ["Meyve hasat rengi:"]=> array(19) { ["key"]=> string(19) "field_5672b9cead1fa" ["label"]=> string(18) "Meyve hasat rengi:" ["name"]=> string(18) "Meyve hasat rengi:" ["_name"]=> string(18) "Meyve hasat rengi:" ["type"]=> string(4) "text" ["order_no"]=> int(6) ["instructions"]=> string(0) "" ["required"]=> int(0) ["id"]=> string(28) "acf-field-Meyve hasat rengi:" ["class"]=> string(4) "text" ["conditional_logic"]=> array(3) { ["status"]=> int(0) ["rules"]=> array(1) { [0]=> array(3) { ["field"]=> string(4) "null" ["operator"]=> string(2) "==" ["value"]=> string(0) "" } } ["allorany"]=> string(3) "all" } ["default_value"]=> string(0) "" ["placeholder"]=> string(0) "" ["prepend"]=> string(0) "" ["append"]=> string(0) "" ["formatting"]=> string(4) "html" ["maxlength"]=> string(0) "" ["field_group"]=> int(16937) ["value"]=> string(11) "Orta yeşil" } }
Only for image field or to all field?
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!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.