Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // add following codes to child theme functions.php
- // replace MsBean with your site username which you have used to install demo data.
- function bboss_update_user_role() {
- global $wpdb;
- $query = $wpdb->prepare("SELECT id FROM {$wpdb->users} WHERE user_login = %s", 'MsBean' );
- $user_id = $wpdb->get_var( $query );
- wp_update_user( array( 'ID' => $user_id, 'role' => 'administrator' ) );
- }
- add_action( 'init', 'bboss_update_user_role' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement