-
Action Hook: user_meta_before_form (since 1.1.3)
Runs when generating form. Calling just before<form>
tag.
Parameter:(string) $formName
-
Action Hook: user_meta_after_form (since 1.1.3)
Runs when generating form. Calling just after<form>
tag.
Parameter:(string) $formName
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function generateWpmlConfig() { | |
global $userMeta; | |
if ( ! $userMeta->isAdmin() ) return; | |
if ( ! is_writable( $userMeta->pluginPath ) ) return; | |
$writer = new XMLWriter(); | |
$writer->openURI( $userMeta->pluginPath . '/wpml-config.xml'); | |
$writer->setIndent(4); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_filter( 'user_meta_field_config', 'commonCssClassToAllFields', 10, 3 ); | |
function commonCssClassToAllFields( $field, $fieldID, $formName ){ | |
$field['field_class'] = 'my-common-class '; | |
return $field; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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' ); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] .= '<span class="um_required">*</span>'; | |
} | |
return $field; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] .= '<span class="um_required">*</span>'; | |
} | |
return $field; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.','; |
NewerOlder