• Resolved mmcinulty

    (@mmcinulty)


    is there a way to enter a custom message to replace the message “Register For This Site”

    i am using the latest version of theme my login

Viewing 9 replies - 1 through 9 (of 9 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    There are a few ways to do this. se whichever you prefer.

    1) Simply copy theme-my-login/templates/register-form.php to your current theme’s directory and remove/alter the following line:
    <?php $template->the_action_template_message( 'register' ); ?>

    2) Create an English translation of the provided theme-my-login.pot file using Poedit. With this route, you can change any of the strings within the plugin. Assuming you are using the English language, you will name the file theme-my-login-en_US.

    3) Apply a callback to the provided ‘tml_action_template_message’ filter by creating a file called theme-my-login-custom.php in your BASE /plugins directory:

    <?php
    function tml_action_template_message_filter( $message, $action ) {
        if ( 'register' == $action )
            return 'My new message';
        return $message;
    }
    add_filter( 'tml_action_template_message', tml_action_template_message_filter', 10, 2 );
    ?>

    A couple things I noticed while getting option 3 above to work.

    1. There’s a missing single quote mark in the above code. The last line should read:

    add_filter( 'tml_action_template_message', 'tml_action_template_message_filter', 10, 2 );

    2. You don’t have to create a file in your /plugins directory–just add the code to your theme’s functions.php

    Plugin Author Jeff Farthing

    (@jfarthing84)

    1. Correct. A typo, indeed.
    2. No, you don’t have to. But if you like to keep related code organized, you should.

    When checking the functionality of this plugin, as far as, the “Register” part is concerned I end up with a too many redirects error page, so, basically, no one can register. Did I miss something in the settings area for this plugin?

    I am trying to get the last few bugs out of this site so my client is happy and makes today my ‘payday’ for the work I have done.

    Thanks,
    Site:
    <beastupathletics.co>

    function tml_action_template_message_filter( $message, $action, $role ) {
        if ( 'register' == $action or 'jobseeker' == $role)
            {return 'You may now log in and submit your resume.';
        return $message; }
    	elseif ( 'register' == $action && 'employer' == $role)
            {return 'Registration Complete. You may now log in.';
        return $message; }
    	else {
    	}
    }
    add_filter( 'tml_action_template_message', 'tml_action_template_message_filter', 10, 2 );

    Is this possible? to have different registration message for users.
    Need a reply please.
    It shows “You may now log in and submit your resume.” even it’s not a jobseeker.

    Plugin Author Jeff Farthing

    (@jfarthing84)

    You can’t just arbitrarily add a third parameter to the callback function and expect it to be populated with the data you want. The filter only passes the message and the action. In fact, there would be no user role for the registration page, because the user wouldn’t be logged in.

    i used hidden fields to separate an employer from jobseeker in register..
    is there any way that they would get different register message?
    please… anyone?

    Plugin Author Jeff Farthing

    (@jfarthing84)

    function tml_action_template_message_filter( $message, $action ) {
    	if ( 'register' == $action ) {
    		switch ( $_REQUEST['role'] ) {
    			case 'jobseeker' :
    				$message = 'You may now log in and submit your resume.';
    				break;
    			case 'employer' :
    				$message = 'Registration Complete. You may now log in.';
    				break;
    		}
    	}
    	return $message;
    }
    add_filter( 'tml_action_template_message', 'tml_action_template_message_filter', 10, 2 );

    I have downloaded and installed POEdit, but when I select “New catalog from POT file” and select the theme-my-login.POT file, I get a fatal error.

    6:33:24 PM: C:\DOCUME~1\Owner\LOCALS~1\Temp\poe2DF.tmp\ref.pot:1185: duplicate message definition…
    6:33:24 PM: C:\DOCUME~1\Owner\LOCALS~1\Temp\poe2DF.tmp\ref.pot:256: …this is the location of the first definition
    6:33:24 PM: msgmerge: found 1 fatal error

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Plugin: Theme My Login] Custom Register Text’ is closed to new replies.