I'm using dokan multivendor, can anyone knows the simple script of forcing all the newly registered to enable the selling mode? when you register as a seller, the selling mode is automatically on, when you register as a customer, the selling mode is off. What I wanted is to have a script of control, for example, if the register register as a contributor or editor, it will automatically make the selling mode "ON".
they have this code:
add_action('gform_post_submission_1', 'marvel_update_dokan_enable_selling', 10, 2);
function marvel_update_dokan_enable_selling() {
$current_user = wp_get_current_user();
$current_user_id = $current_user->ID;
update_user_meta( $current_user_id, 'dokan_enable_selling', 'yes' );
}
but this is for gravity forms
user_register
and then check the role of the user and update theirdokan_enable_selling
accordingly? codex.wordpress.org/Plugin_API/Action_Reference/user_register