Is there a way to override or hook this change so I don’t lose when I update?
I found where default role is being set within importer.php around line 718
I commented out original which had checked=’checked’
if($key == "subscriber")
//echo "<label style='margin-right:5px;'><input name='role[]' type='checkbox' checked='checked' value='$key'/>$value</label>";
echo "<label style='margin-right:5px;'><input name='role[]' type='checkbox' value='$key'/>$value</label>";
else
echo "<label style='margin-right:5px;'><input name='role[]' type='checkbox' value='$key'/>$value</label>";
}
Thank you for your time
@mowlman,
If you want, we continue this by this thread.
Yes. We have a process where we have customers sign up to be in a special shopper group. We were going to use your CSV import to import the users from our other site which happens a couple times a week. We are not using Subscriber so much but our new shopper rule called Contractor1 which will be the case 99% of the time. So i thought if I do Not have anything automatically checked, when we perform an import we can check the appropriate role as needed.
Sorry for the similar thread, i will go in and close it or reference this thread.
I just don’t know if I can override within my functions.php file somehow or I will just have to keep re-applying the change after each update.
@mowlman,
Most of the users want to upload their users as “Subscriber” so it would be bad for most of the users do it as you want.
It has no sens to make a hook here, maybe the best solution would be to “remember” the last selection.
What do you think about it? Could you help us with the code or maybe with a little donation?
Tell me.
Yes, having option saved within user_meta would work. Have not checked yet, are you already using a specific meta key?
@mowlman, it would be a custom develop.
Hello Javier,
I can try to make time to code it, I just wasn’t sure if you were already using a specific meta_key within the usermeta table for Import Users From CSV with Meta , something beginning with IUCM for example. Just wanted to be consistent with any of your other code that might be using the usermeta table
So meta_key would be something like: iucm_default_role
meta_value: Subsriber would be an example value.
I’ll have to also edit importer.php to save and read in the meta key / value pair
My initial thought was to save the default role within the usermeta table so each user could have their own default, but could also just possibly use the wp_options table?
Uhm… not you should use the same way the plugin use in other options.
If you don’t do it, we cannot include any code in the plugin.
If you are not sure about how to do it, we will include it in future features. If you need it fast, send us a mail and we talk: contacto@codection.com.
Thanks.
Javier