Skip to content

Instantly share code, notes, and snippets.

@webdevs-pro
Created December 5, 2019 12:08
Show Gist options
  • Save webdevs-pro/48fd663d7409dd1b4fcbabbba97d32e5 to your computer and use it in GitHub Desktop.
Save webdevs-pro/48fd663d7409dd1b4fcbabbba97d32e5 to your computer and use it in GitHub Desktop.

Revisions

  1. webdevs-pro created this gist Dec 5, 2019.
    13 changes: 13 additions & 0 deletions index.php
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    <?php
    add_filter('acf/validate_value/name=user_password_confirm', 'my_validated_password_filter', 10, 4);
    function my_validated_password_filter($valid, $value, $field, $input) {
    if (!$valid) {
    return $valid;
    }
    // field key of the field you want to validate against
    $password_field = 'field_5de8dff728aa2';
    if ($value != $_POST['acf'][$password_field]) {
    $valid = 'Does Not Match Password';
    }
    return $valid;
    }