Home › Forums › ACF PRO › Validation looks 'unexpected' › Reply To: Validation looks 'unexpected'
I just remembered I fixed this issue and still had this open.
This is my solution:
function pg_check_values( $valid, $value, $field, $input ) {
// bail early if value is already invalid
if ( ! $valid ) {
return $valid;
}
if ( 1 == $value ) {
if ( isset( $_POST[ 'acf' ][ 'field_5adf64026e9a8' ] ) && empty( $_POST[ 'acf' ][ 'field_5adf64026e9a8' ] ) ) {
$valid = __( 'Please enter a start date', 'dpg' );
}
}
return $valid;
}
add_filter( 'acf/validate_value/name=pg_ready_to_check', 'pg_check_values', 10, 4 );
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.