Theme My Login
Filtering Markup for Error Messaging (2 posts)

  1. djquinn
    Posted 2 years ago #

    Hi there, it seems like it's not possible to filter the markup that comes out of get_errors() in the plugin.

    For example, in any of the form templates, we have this at the top:

    <?php $template->the_action_template_message( 'login'); ?>
    	<?php $template->the_errors(); ?>

    I can change the markup that comes out of the_action_template_message by using the $before and $after parameters, but the markup that comes out of the_errors has hardcoded markup coming from the get_errors() function:

    It's on line 223 of class-theme-my-login-template.php:

    if ( ! empty( $errors ) )
    $output .= '<div class="error">' . apply_filters( 'login_errors', $errors ) . "</p>\n";
    if ( ! empty( $messages ) )
    $output .= '<p class="message">' . apply_filters( 'login_messages', $messages ) . "</p>\n";

    If you removed the p tags in there, we'd be able to add our own markup by using your filters for login_messages and error_messages.


  2. djquinn
    Posted 2 years ago #

    Apologies, I've sent this feature request to you via your form.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Theme My Login
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic