Forum Replies Created
-
AuthorPosts
-
December 15, 2019 at 3:17 PM in reply to: ✅Registration: username as email, duplicated fields, avatar, visibility issue #17529
Mauro
ParticipantOK, that works, but I can't decide the order of the fields. Can live with it but would be nice to be able to put i.e. first name and last name above the email and password fields.
One more thing, can I hide the password field and have WP generate one and send it in email with the welcome message?
December 13, 2019 at 5:33 PM in reply to: ✅Registration: username as email, duplicated fields, avatar, visibility issue #17516Mauro
ParticipantThanks for this Anh!
The email as username flag works fine as far as I can tell.
Unfortunately I still see duplicated fields in the form generated in the shortcode for the registration form.This is my shortcode:
[mb_user_profile_register form_id="profile-form" id="registration-fields" id_username="email" id_password="password1" id_password2="password2" label_submit="Register" confirmation="Your account has been created successfully." email_as_username="true"]Am I doing something wrong?
Here is my meta box setup for this:
$meta_boxes[] = [ 'title' => '', 'id' => 'registration-fields', 'type' => 'user', // NOTICE THIS 'fields' => [ [ 'id' => 'first_name', // THIS 'name' => 'First Name', 'type' => 'text', ], [ 'id' => 'last_name', // THIS 'name' => 'Last Name', 'type' => 'text', ], [ 'id' => 'email', // THIS 'name' => 'E-Mail', 'type' => 'email', ], [ 'id' => 'password1', // THIS 'name' => 'Password', 'type' => 'password', ], [ 'id' => 'password2', // THIS 'name' => 'Confirm Password', 'type' => 'password', ], [ 'id' => 'gender', // THIS 'name' => 'Gender', 'type' => 'radio', 'options' => array('m'=>'M','f'=>'F'), ], [ 'id' => 'birthday', // THIS 'name' => 'Date of Birth', 'type' => 'date', //'readonly' => true, 'js_options' => array( 'dateFormat' => 'dd-M-yy', 'changeYear' => true, 'yearRange' => "1930:2010" ), 'save_format' => 'Y-m-d', ], [ 'id' => 'country', // THIS 'name' => 'Country', 'type' => 'select_advanced', 'options' => $this->countries, ], [ 'id' => 'privacy', // THIS 'name' => 'Privacy Policy', 'type' => 'checkbox', 'desc' => 'I have read and agree to the <a href="/privacy" target="_blank" rel="noopener noreferrer">Privacy Policy</a>', 'required' => 'This field is required to complete registration', ], ], ];November 20, 2019 at 2:54 PM in reply to: ✅Feature Suggestion: one query to get all custom fields in a group #17021Mauro
ParticipantThis is good news, but it still means you need to call it and hit the DB for each post rather then doing one DB query to get the posts and the meta you need together in one object.
November 19, 2019 at 6:55 PM in reply to: Map Coordinates update not triggering in front-end user profile #17005Mauro
ParticipantHi Anh, can you give me the js function to trigger the map update?
It's probably a one liner?Mauro
ParticipantI had to disable this recently and reset readonly => false because it didn't show the calendar anymore. Not sure what broke this.
November 19, 2019 at 6:12 PM in reply to: ✅Registration: username as email, duplicated fields, avatar, visibility issue #17003Mauro
ParticipantHi Anh, did you have a chance to address these things?
If so, how do I setup the form to hide the username?Mauro
ParticipantOh I see... so the coordinates are updated based on the pin location!
That was unclear, especially with the "find address" button in the mix.
Perhaps read-only fields with latitude and longitude would make it more clear to the user that he can drag the pin to fine-tune the location.Thanks Anh! I'm loving developing with MetaBox.
Mauro
ParticipantThat's better!
I'm still confused on one thing... why can I drag the pin around in the map?
Won't the coordinates be taken from the autocomplete address field anyway?Mauro
ParticipantOK will try today!
BTW, I'm working on a front-end implementation using Leaflet and I found it useful to include this JS library to avoid scrolling the map while scrolling the page: https://github.com/elmarquis/Leaflet.GestureHandlingMauro
ParticipantThanks Anh!
I'm currently using the MetaBox AIO plug-in on this project.
I followed the link but it looks like it's the main MetaBox plug-in, not the Geolocation extension?
Should I replace the main MetaBox plug-in with the one from the commit?Mauro
ParticipantOh forget it, my bad. I had an array enclosing location fields.
Mauro
ParticipantAt a glance, it feels like MetaBox is not loading the necessary resources for the Geolocation fields within the user profile and in the front-end.
November 23, 2018 at 4:11 PM in reply to: ✅2-ways relationship in facet for related post types, when both are in template #12182Mauro
ParticipantHi Anh, will do.
September 8, 2018 at 10:15 PM in reply to: ✅Set meta value of custom user field programmatically #11290Mauro
ParticipantI'm trying with update_user_meta, seams the logic option 🙂
Mauro
ParticipantThis is actually quite easy and will add the profile picture in your wp-admin profile screen.
// Add User Profile Support add_filter( 'rwmb_meta_boxes', 'your_prefix_register_user_meta_boxes' )); function your_prefix_register_user_meta_boxes( $meta_boxes ) { $meta_boxes[] = array ( 'title' => 'Profile Picture', 'id' => 'profile_picture', 'fields' => array( array ( 'id' => 'custom_avatar', 'type' => 'single_image', 'name' => 'Upload Avatar', ), ), 'type' => 'user', ); return $meta_boxes; }To get the avatar URL use:
// Check if MetaBox is available if (function_exists('rwmb_meta')) { // Get the attachment object $avatar = rwmb_meta( 'custom_avatar', array( 'object_type' => 'user' ), $user_id ); // Check if the user has a custom avatar, get the URL if ($avatar) $avatar_url = $avatar['url']; // this will get the 150x150 sized avatar // If no avatar is set, use your own custom one else $avatar_url = site_url().'path/to/your/default/avatar.jpg'; } -
AuthorPosts