Action links can be changed by using the tml_action_url filter. This filter passes in three arguments to your callback function. The first argument is the current action URL being filtered. The second argument is the current action being used. The third argument is the instance identifier.

Let’s say you wanted to change the Register action link to a different URL:

If you wish to require a field or perform any other kind of validation, you will do so using the registration_errors filter.

3. Save the new fields

You will save the new fields by creating a callback function for the user_register action. Within this callback function, you will more than likely be using update_user_meta() to save the fields, depending on your situation and what fields you are trying to save.

Examples

The following is an example of adding first name and last name to the registration form. These fields will be required.

Add the new fields

Add the following to your copy of register-form.php anywhere between the <form> and </form> tags.

There are a few methods that can be used in order to change the page titles of Theme My Login.

The first method is simply by creating your own English translation of Theme My Login.

The second method involves the use of the tml_page_title filter. This filter passes in two arguments to your callback function. The first argument is the title of the page being filtered. The second argument is the current action being used.

Generally, when adding random code to your site using WordPress, you would add it to your theme’s functions.php file. However, in an effort to keep code more organized, Theme My Login provides you with the option of using a specific file for related code. This file is called theme-my-login-custom.php and it must reside in /wp-content/plugins.

When theme-my-login-custom.php is present, it is always loaded when the plugin is loaded. This means that the earliest hook available within the file is the plugins_loaded action.

By default, Theme My Login includes a minimal stylesheet, titled theme-my-login.css, from the plugin directory. In most cases, this is all the styling needed for a decent looking log in form. However, some themes may “mess it up” or you may just need something more customized. This is where the custom stylesheet comes in to play. If you create a copy of theme-my-login.css in your theme’s directory, this version will be loaded instead of the default version. This is a great way to maintain your customizations between plugin upgrades.

CSS Selectors

Theme My Login uses most of the same selectors as the default login page. However, for ease of targeting, all Theme My Login forms are wrapper in a DIV with a class of “login” applied. This same DIV also has an ID of “theme-my-login” with the instance appended to it. This is particularly useful when using the template tag or shortcode, as you can assign your own instance with the “instance” argument. You can then use that instance ID to target that particular form.