Hallo,
ich nutze ultimatemember und möchte im Registrierungsformular ein Feld beim Absenden des Formulares prüfen.
Feld heißt Gutschein und soll nur einen bestimmten Wert enthalten.
Ich habe es nach der Vorgabe des Anbieters umgesetzt.
https://docs.ultimatemember.com/article/94-app…tion-to-a-field
Erhalte aber folgende Fehlermeldung:
[07-Jul-2018 11:22:56 UTC] PHP Notice: Undefined property: UM::$form in *****/functions.php on line 596
[07-Jul-2018 11:22:56 UTC] PHP Fatal error: Uncaught Error: Call to a member function add_error() on null in /****/functions.php:596
Hier mein Code:
add_action('um_submit_form_errors_hook_','um_submit_form_errors_hook_custom', 999, 1);
function um_submit_form_errors_hook_custom( $args ) {
global $ultimatemember;
if ( isset( $args['gutschein'] ) && trim($args['gutschein']) != '' $args['gutschein'] != 'XXX' ) {
$ultimatemember->form->add_error( 'gutschein', 'Dieser Gutscheincode ist ungültig' );
}
}
Hat jemand eine Idee für mich?