Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

How can I trigger a message box to appear on the login form?

I'l trying to get the little yellow notice bar to appear above the login form conditionally.

The below code only print the content on the page (duh, I know).

add_action('login_head', 'login_form_message');
function login_form_message() {
    echo 'Custom Login Form Message';
}
share|improve this question
add comment

1 Answer 1

up vote 2 down vote accepted

There's a filter to add messages there. You can sneak in messages that will than handled like an error message (without being one).

apply_filters( 'login_message', $message );

Here's an example of this filter:

function wpse79920_login_msg( $message )
{
    return 'Hello User!';
}
add_filter( 'login_message', 'wpse79920_login_msg' );
share|improve this answer
    
Thank you! That lead me to this: jarrodpyper.com/blog/… –  mattrepublic Jan 9 '13 at 21:20
    
@mattrepublic Wat? Don't get your point - didn't you want to add a message? –  kaiser Jan 9 '13 at 21:34
    
Yes, adding the <p class="message"> put Hello user! in the box. I wouldn't have found that without the filter name you gave me. I'll be sure to dig deeper into filter next time. –  mattrepublic Jan 9 '13 at 23:49
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.