Forum Replies Created
-
AuthorPosts
-
ingegnimultimediali
ParticipantEmail field is empty.
but if I want only to edit a single meta box field, why I must insert my password?https://www.dropbox.com/s/nfvw9ykq5an1jv1/edit.png
If I insert an email that was already used by other user, no error message was displayed or returned
ingegnimultimediali
Participantno, in edit form all fields of meta box are filled, but email and password are empty
ingegnimultimediali
ParticipantI solved by using user_register action
add_action( 'user_register', 'test');
function test( $user_id ) {
add_user_meta( $user_id, 'user_field', 'field_value' );}
ingegnimultimediali
ParticipantI'm sorry for last reply... the 2nd snippet is correct and it works fine
using rwmb_profile_insert_user_data is it possible to return the
$this->user_id = wp_insert_user( $data );??
Know the user_id value will allow to do many other things
ingegnimultimediali
Participant#2 the correct attribute is user_id
however the meta box is correctly populate, but email and passwords fields are empty.
If I insert new values for email and password in these empty fields the values are not savedingegnimultimediali
Participantwhit the 2nd snippet the user_email value is not saved in user account
ingegnimultimediali
ParticipantHi Anh,
now it's works.Another question:
if I would to customize only username e password, but insert user_email field in form, I useadd_filter( 'rwmb_profile_register_fields', 'addfield', 10, 1); function addfield($fields){ $fields = array( array( 'type' => 'email', 'name' => 'Email', 'id' => 'user_email', 'required' => 1 )); return $fields; }to display user_email with my form
This hook works but not save user_email value in user account
I've used this rwmb_profile_insert_user_data
add_filter( 'rwmb_profile_insert_user_data', function ( $data, $config ) { // User strpos because the $config also contains default register form. if ( false === strpos( $config['id'], 'user-account' ) ) { return $data; } // Custom data for user. $data = [ 'user_login' => 'my_user3', 'user_pass' => 'my_user_pass', ]; return $data; }, 10, 2 );ingegnimultimediali
ParticipantHi anh,
the update action to 1.0.2 fail...and the #2 error remaining...
Fatal error: Uncaught Error: Call to undefined function info() in /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/class-mb-user-profile-user.php:105 Stack trace: #0 /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/class-mb-user-profile-user.php(57): MB_User_Profile_User->create() #1 /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/forms/class-mb-user-profile-form.php(110): MB_User_Profile_User->save() #2 /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/shortcodes/class-mb-user-profile-shortcode-register.php(43): MB_User_Profile_Form->process() #3 /home/xxxxxxxx/wp-includes/class-wp-hook.php(286): MB_User_Profile_Shortcode_Register->process('') #4 /home/xxxxxxxx/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home/xxxxxxxx/website/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/xxxxxxxx/wp-includes/template-loader.php(12): do in /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/class-mb-user-profile-user.php on line 105
ingegnimultimediali
ParticipantThanks for update, but...
-
always show error notify "Your username already exists."
-
after submit form --> Fatal error: Uncaught Error: Call to undefined function info() in /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/class-mb-user-profile-user.php:105 Stack trace: #0 /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/class-mb-user-profile-user.php(57): MB_User_Profile_User->create() #1 /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/forms/class-mb-user-profile-form.php(110): MB_User_Profile_User->save() #2 /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/shortcodes/class-mb-user-profile-shortcode-register.php(43): MB_User_Profile_Form->process() #3 /home/xxxxxxxx/wp-includes/class-wp-hook.php(286): MB_User_Profile_Shortcode_Register->process('') #4 /home/xxxxxxxx/wp-includes/class-wp-hook.php(310): WP_Hook->apply_filters(NULL, Array) #5 /home/xxxxxxxx/wp-includes/plugin.php(453): WP_Hook->do_action(Array) #6 /home/xxxxxxxx/wp-includes/template-loader.php(12): do in /home/xxxxxxxx/wp-content/plugins/mb-user-profile/inc/class-mb-user-profile-user.php on line 105
ingegnimultimediali
ParticipantHi Anh,
any updates?
I'm thinking about a solution with rwmb_profile_insert_user_data
If I hidden required fields in the form, is it possible to set custom value by user data filter?
what do you think about it?ingegnimultimediali
ParticipantHi,
It seems that the problem was resolved
thanksingegnimultimediali
ParticipantHi,
I've replicate all on a pilvia installation.https://mbtest.demo.site/wp-admin/
user: mbtest-admin
pass: demopasshttps://app.pilvia.com/yourphpmyadmin/copper/sql.php?server=1&db=mbtest&table=wp_customtable&pos=0
user: mbtest
pass:h6YeC7yceywcgUEScenario:
CPT test #1 -> Test CPT test #1 (metabox with custom table wp_customtable)
when I save CPT also wp_customtable was populateCPT test #2 -> no metabox
when I save CPT nothing happened on wp_customtablestandard posts -> (ONLY ONE METABOX) "new meta box for posts" (metabox for standard post)
when I save new post also wp_customtable was populate with an empty row (only postId and AI)Pages -> two classic metabox
when I save a new page nothing happened on wp_customtableingegnimultimediali
ParticipantHi,
I’ve do several test.
when I have a cpt with metabox with custom table I’ve seen this behavior:
If I have other cpt without metabox there’s nothing happened when it is Saved.
But if another cpt has only one metabox, the custom table was populate with an empty row.
when I have more metabox for other cpt nothing happened when it is saved.
Is there some bug?ingegnimultimediali
ParticipantThe metabox for custom table is correctly set and view only on order post
ingegnimultimediali
ParticipantNow it works fine!
Thnks -
-
AuthorPosts