Use field title as placeholder
If you like to use the field title as a placeholder, put following code to your functions.php
add_filter( 'user_meta_field_config', 'titleAsPlaceholder', 10, 3 ); function titleAsPlaceholder( $field, $fieldID, $formName ) { if ( !empty( $field['field_title'] ) ) $field['placeholder'] = $field['field_title']; return $field; }
Build custom login form
You can assign any form to your login form. so lets create our custom login form.
Create a new form for login, add Username and Password field to the form, for “Remember me” add a checkbox with
Meta Key: rememberme
Field Options: 1=Remember me
If you want the checkbox to be pre checked, put 1 to Default Value
Finally use the login shortcode on any page,
Shortocde: [user-meta-login form="My_Login_Form"]
(Assuming My_Login_Form is the name of your login form)
Category as options for dropdown/select/multiselect
add_filter( 'user_meta_field_config', 'user_meta_field_config_populate_categories', 10, 3 ); function user_meta_field_config_populate_categories( $field, $fieldID, $formName ){ if( $fieldID != 'Your_Field_ID' ) // Put your desired field id here return $field; $output = null; $cats = get_categories(); foreach( $cats as $cat ): $output .= $cat->term_id.'='.$cat->name.','; endforeach; $output = ',' . trim( $output, ',' ); $field['options'] = $output; return $field; }
User Meta Pro is a well-designed, feature-rich. It is easy to use user management plugin. Since, it allows front-end profile update, user registration with extra fields. Additionally, email notifications and many more. As, User Meta Pro is also a versatile user profile builder and user management plugin for WordPress. However, it has the most features on the market
Add red asterisk(*) to all required fields
add_filter( 'user_meta_field_config', 'user_meta_field_config_add_asterisk', 10, 3 );
function user_meta_field_config_add_asterisk( $field, $fieldID, $formName ){
if( !empty($field['required']) || in_array($field['field_type'], array('user_login', 'user_email')) ){
if( !empty( $field['field_title'] ) )
$field['field_title'] .= '*';
}
return $field;
}
Add custom required class to all required fields
add_filter( 'user_meta_field_config', 'user_meta_field_config_add_class', 10, 3 ); function user_meta_field_config_add_class( $field, $fieldID, $formName ){ if( !empty($field['required']) || in_array($field['field_type'], array('user_login', 'user_email')) ){ $field['field_class'] = 'your_required_class '; // leave an empty space after classname } return $field; }
Change resetpass page
To change default “resetpass” to “verify” put following codes to your functions.php
add_filter('user_meta_front_execution_page', create_function('','return "verify";'));
Customize Label for Login Form
To customize default label for login form, edit and put following code to your functions.php file:
add_filter( 'user_meta_default_login_form', 'user_meta_default_login_form_function' ); function user_meta_default_login_form_function( $config ){ $config['login_label'] = "Your desire text for login input"; $config['pass_label'] = "Your desire text for password input"; $config['remember_label'] = "Your desire text for rember me checkbox"; $config['button_value'] = "Your desire text for login button"; return $config; }
User Meta Pro is a well-designed, feature-rich. It is easy to use user management plugin. Since, it allows front-end profile update, user registration with extra fields. Additionally, email notifications and many more. As, User Meta Pro is also a versatile user profile builder and user management plugin for WordPress.User Meta Pro YouTube customize label
Redirection after profile update
Put following code to functions.php for redirecting user after profile update.
add_action( 'user_meta_after_user_update', 'user_meta_after_user_update_function' ); function user_meta_after_user_update_function( $response ){ global $userMeta; echo $userMeta->jsRedirect( 'http://example.com' ); }
Extend date range
To extend date range from default one use following hooks:
add_filter( 'user_meta_field_config', 'user_meta_field_config_function', 10, 3 ); function user_meta_field_config_function( $field, $fieldID, $formName ){ if( $fieldID != 0 ) // Replace 0 with your filed id return $field; $field['field_options'] = array( "yearRange"=>"1900:c" ); return $field; }
Please note, you need to change field id in this example, or you can use any other algorithm to filter your field.
You can pass more options to control the datepicker through $field[‘field_options’] as an array.
Use non-ajax file upload field
If for any case, ajax file upload solution is not working for you, you can switch to non-ajax solution.
To choose non-ajax file upload, follow those steps:
1. Go to User Meta >> Fields Editor, expand your file upload field (or avatar field) and check “Disable AJAX upload” checkbox, save your change.
2. Go to User Meta >> Forms Editor, expand your form and check “Do not use AJAX submit” checkbox and save your change.
Form based redirection
User Meta Pro support several types of role based redirection. You can control login, logout, registration redirection from User Meta >> Settings (Redirection Tab)
You can also set form based redirection. To set form based redirection, follow those steps:
1. Go to User Meta >> Settings (Redirection Tab) and choose “Referer” option, Save your change.
2. Go to User Meta >> Fields Editor, Create a HTML field. Enter following code(change url) into “Default Value” input field
<input type="hidden" name="redirect_to" value="http://example.com/redirected_url">
3. Go to User Meta >> Forms Editor, Drag your new html field to your form.
Add registration link after login form
To add registration link after default login form, add following codes to your functions.php (under current theme directory):
add_filter( 'user_meta_default_login_form', 'addRegistrationLink' ); function addRegistrationLink( $config ){ $config['after_form'] = 'Registration'; return $config; }