Support

Account

Home Forums Backend Issues (wp-admin) Validation URL domain Reply To: Validation URL domain

  • Thanks for your reply.

    I put this in my function.php but it doesn’t work

    add_filter('acf/validate_value/key=field_5ab2ca68fcf2b', 'my_acf_validate_value', 10, 4);
    
    function my_acf_validate_value( $valid, $value, $field, $input ){
    
                    echo "erreur";
                    if( !$valid ) {
                                    return $valid;
    }
    
    $string = urldecode(get_field("url"));
    
    $parse = parse_url($string);
    echo $parse['host'];
    
    if ($parse['host'] != "www.amazon.fr") {
    
    		$valid = 'Erreur';
    
    	}
    
                    return $valid;
    
    }