I have a theme called wplms, used for learning management system.
I need to allow instructors of courses to register in website directly as instructors (not students) and I need too that the administrator don’t have to moderate each instructorâs registration.
For it, Iâve modified core of bp-members/bp-members-classes.php
In line 314, I have commented the line:
$wpdb->query( $wpdb->prepare( "UPDATE {$wpdb->users} SET user_status = 2 WHERE ID = %d", $user_id ) );
because I want activate the user (instructor) just registered
And in lines 319 and 320 Iâve commented:
delete_user_option( $user_id, âcapabilitiesâ );
delete_user_option( $user_id, âuser_levelâ );
because these lines are overwritting the wp_capalities that I previously defined.
But I want to do this without modify the core. Could you give me a better way?
Thanks very much.
NOTE: Iâve noticed that the user registered appears in wp admin > users as instructors as wellâ¦but too as pendingsâ¦
There is one hook when the method
add_backcompat()
returns its results. With it you could reverse what$wpdb->query
anddelete_user_option
have done.You have to find out what you need to fill the function: