Action
rpress_print_errors
Fires at the top of the registration form to print queued error messages.
Runs in the registration shortcode before the form is output. RestroPress attaches rpress_print_errors() to this hook, which prints errors stored in the session. Removing that callback hides registration errors.
Example#
remove_action( 'rpress_print_errors', 'rpress_print_errors' );
add_action( 'rpress_print_errors', 'my_print_errors' );
function my_print_errors() {
$errors = rpress_get_errors();
if ( $errors ) {
foreach ( $errors as $error ) {
echo '<p class="my-error">' . esc_html( $error ) . '</p>';
}
rpress_clear_errors();
}
}
Notes#
Core already hooks rpress_print_errors() here.
Source#
Fired from:
templates/shortcode-register.php(line 10)
See also#
Was this page helpful?
