Change the submit button on the registration form to “Register”

 

I recently was ask be a couple of users how they could change the submit button on the registration form to say “Register” instead of “Submit”.  While some users might just change that in the plugin’s core files, that is not the right way to go about it since that would be easily overwritten when you upgrade the plugin.

The right way to do this is with the wpmem_register_form filter and php’s str_replace function.  Here is a simple example you could add to your theme’s functions.php file:

add_filter( 'wpmem_register_form', 'my_submit_button_filter' );
function my_submit_button_filter( $string ) {

	// the parameter $string is the 
	// generated html of the form

	// use str_replace like:
	// $new_string = str_replace( $needle, $replacement, $haystack );
	
	global $wpmem_a;
	
	$new_text = ( $wpmem_a == 'edit' ) ? 'Update Profile' : 'Register';
	
	$string = str_replace( 'Submit', $new_text, $string );
	
	return $string;

}

This could be modified to filter the “clear form” button as well, or to change the text to whatever is needed.

Private

You do not have permission to view this forum.