Advanced Custom Fields: Hidden Field
Hidden Field For ACF (Advanced Custom Fields) WordPress Plugin
by Mehrshad Darzi · github.com/mehrshaddarzi/acf-hidden-field · website
★ 1stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/mehrshaddarzi/acf-hidden-field/archive/refs/heads/master.zipReadme
Hidden Field For ACF (Advanced Custom Fields) WordPress Plugin

for Use Custom JavaScript Action in Input, use acf_hidden_field_custom_script action:
add_action('acf_hidden_field_custom_script', 'add_default_value');
function add_default_value($field) {
?>
<script>
jQuery(document).ready(function ($) {
/**
* https://www.advancedcustomfields.com/resources/javascript-api/
*/
acf.addAction('load', function () {
let input = $("#acf-<?php echo $field['key']; ?>");
if (input.val().length < 1) {
input.val("a new value");
}
});
});
</script>
<?php
});