WordPress.org

Ready to get started?Download WordPress

Forums

New User Approve
[resolved] Using Filters to Customize Messages (3 posts)

  1. Andrew
    Member
    Posted 1 year ago #

    Hi Picklewagon,
    Thanks for your work on this plugin. It's been working good so far. I wanted to tweak the output of the messages on the login and register pages and I see you provided filters in order to do that within the plugin, but I'm not very good with PHP and the function I've written (my theme's functions.php) to tap into your filters keeps causing 500 Internal server error's.

    // Plugs into New User Approve Plugin to customise login message
    
    function customize_welcome_message($welcome) {
          $welcome = echo 'This login is for students of Naada Yoga\'s Teacher Training program only. If you are looking to pay for or sign up for classes go <a href="http://clients.mindbodyonline.com/asp/ws.asp?studioid=6387">here.</a>';
        }
    add_filter( 'new_user_approve_welcome_message', 'customize_welcome_message' );

    Can you see why this wouldn't be working? Is it something about variable scope?

    Thanks a bunch.

    http://wordpress.org/extend/plugins/new-user-approve/

  2. Josh Harrison
    Member
    Plugin Author

    Posted 1 year ago #

    Try the following code and you should be good to go:

    function customize_welcome_message( $welcome ) {
    	$welcome = 'This login is for students of Naada Yoga\'s Teacher Training program only. If you are looking to pay for or sign up for classes go <a href="http://clients.mindbodyonline.com/asp/ws.asp?studioid=6387">here.</a>';
    	return $welcome;
    }
    add_filter( 'new_user_approve_welcome_message', 'customize_welcome_message' );
  3. Andrew
    Member
    Posted 1 year ago #

    Thanks Picklewagon!
    I see I was missing the 'return $welcome' and perhaps also the HTML entities used in the link tag could have been causing problems too?

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic