Hi @derevan007,
If you trying to throw an error from a third-party plugin to the User Registrations’ login form error section then there are two ways that you can use.
First, you can modify the error.php file and write custom code there by yourself and achieve this. But since this includes code modifying, we will not be able to assist you on this and we do not recommend code editing too since it might cause the plugin to misbehave. You can only do this if you are familiar with working with PHP and have a good grasp of it.
Second, you can use a filter to change the error message. You can use this filter apply_filters( 'user_registration_add_' . $notice_type, $message );
The $notice_type needs either the error or success as a value that needs to be passed and the $message will have the message. The error message can be based on conditions that you will need to define while writing the code.
I hope it helps.
Regards!
Thanks for the help. Unfortunately, I’ve tried both of the options you suggested to no avail. I added debug messages to error.php and I can see that it DOES have the proper message. It just does not show up on the form (ie, it did not insert the user-registration-error class into the form). The form URL does show with ?login-error at the end.
<ul class=”user-registration-error”>
<?php foreach ( $messages as $message ) : ?>
- <?php echo wp_kses_post( $message ); ?>
<?php endforeach; ?>
I found a solution to my problem. In the 3rd party plugin, I added a call to the following:
ur_print_notices();
The error message is now showing up.