Cell Phone Field
-
Hello guys, awesome plugin!
Is it possible to have a Cell Phone number field on the page where this short-code is inserted: [clean-login-edit] ? There is already the perfect spot for it right next to the email field. I think this would be a killer feature!
-
Hi Wachamacallit,
This feature, the way to add fields in the edit form, is not included in Clean Login. If you want to support the development we can code it for you (as the company we are). Please write us at contacto(at)codection(dot)com with all the requirements.
Regards,
Alberto.
Ok, I just sent you an email.
Thanks!If anyone else would like this functionality..
On line 301 of clean-login.php add this line:
update_user_meta( $current_user->ID, 'billing_phone', sanitize_text_field( $_POST['phone'] ) );
On line 27 of content/login-edit.php, add this:
<div class="cleanlogin-field"> <label><?php echo __( 'Phone', 'cleanlogin' ); ?></label> <input type="text" name="phone" value="<?php echo $current_user->billing_phone; ?>"> </div>
There is obviously no phone validation though – it will accept anything. Compatible with (and without) WooCommerce.
Oh wow! THANK YOU SO MUCH MR. BRIAN!
You are a RockStar!!If it isn’t too much to ask, could you please also let us know how to add a column, displaying all the users phones to the back end admin user page?
Here is a screen shot of what I mean:
https://screencloud.net/v/gCatHere ya go:
function mrb_modify_user_columns($column_headers) { unset($column_headers['posts']); $column_headers['phone'] = 'Phone'; return $column_headers; } add_action('manage_users_columns','mrb_modify_user_columns'); function mrb_user_phone_column_content($value, $column_name, $user_id) { $user = get_userdata( $user_id ); if ( 'phone' == $column_name ) { return '<a href="tel:' . $user->billing_phone . '">' . $user->billing_phone . '</a>'; } return $value; } add_action('manage_users_custom_column', 'mrb_user_phone_column_content', 10, 3);
If you don’t want to remove the posts count column, simply comment/remove the second line that says unset.
OH MAN!!
It’s because of people like you that the economy progresses!
Thank you ever so much Mr. Brian!!Do you do any freelancing work on your own?
Every now and then I need a programing pro.Hi everybody,
Below the answer to an email we have received related with this thread:
Hello Codection Team
A while back I had a great idea, (in my opinion) that would make your Clean Login Plugin even better!
Thankfully, a skillful developer volunteered his time and provide a few lines of code to make it a reality so I thought it would be good to share it with you, perhaps you would want to integrate it as part of your official version and be benefited in some way.
My idea was to add a Cell Phone Field and you can achieve this by:
On line 301 of clean-login.php add this line:
update_user_meta( $current_user->ID, ‘billing_phone’, sanitize_text_field( $_POST[‘phone’] ) );
On line 27 of content/login-edit.php, add this:<div class=”cleanlogin-field”>
<label><?php echo __( ‘Phone’, ‘cleanlogin’ ); ?></label>
<input type=”text” name=”phone” value=”<?php echo $current_user->billing_phone; ?>”>
</div>
FOR THE FUNCTIONS PHP:function mrb_modify_user_columns($column_headers) {
$column_headers[‘phone’] = ‘Phone’;
return $column_headers;
}
add_action(‘manage_users_columns’,’mrb_modify_user_columns’);function mrb_user_phone_column_content($value, $column_name, $user_id) {
$user = get_userdata( $user_id );
if ( ‘phone’ == $column_name ) {
return ‘billing_phone . ‘”>’ . $user->billing_phone . ‘‘;
}
return $value;
}
add_action(‘manage_users_custom_column’, ‘mrb_user_phone_column_content’, 10, 3);
CREDIT GOES TO MR BRIANAnswer:
Hi MrBrian (or Francisco, the person who wrote the email, it’s clearly undefined),
Thanks for your collaboration. We have no problem by including this code in the Clean Login plugin, but currently is used by more than seven thousand people, and if this change is not optional we can not force everybody to include this new field. If you want to update the part of the setting area to choose this new feature as optional we will be delighted to update the plugin with those changes. I hope you understand.
Regards,
Alberto.
Please which file and line exactly do i place the last code
“function mrb_modify_user_columns($column_headers) {
unset($column_headers[‘posts’]);
$column_headers[‘phone’] = ‘Phone’;
return $column_headers;
}
add_action(‘manage_users_columns’,’mrb_modify_user_columns’);function mrb_user_phone_column_content($value, $column_name, $user_id) {
$user = get_userdata( $user_id );
if ( ‘phone’ == $column_name ) {
return ‘billing_phone . ‘”>’ . $user->billing_phone . ‘‘;
}
return $value;
}
add_action(‘manage_users_custom_column’, ‘mrb_user_phone_column_content’, 10, 3);”Please I need to know!
Hello Anyiduru
I placed that code in a plugin that I got for free and it worked for me:
https://dl.dropboxusercontent.com/u/52549925/AAA-CF%20Plugin.zip
God bless you The Wachamacallit.
I have gotten it at last.
I place the code in function.php file on theme template folder.You are a saint!
Thanks again.What php code can I use to make the phone field REQUIRED?
I want it to output error code when phone field is left blank during registration.
- The topic ‘Cell Phone Field’ is closed to new replies.