$metadata = wp_get_attachment_metadata( $thumbnail_id ); $base_url = wp_upload_dir()['baseurl']; if ( ! empty( $metadata['sizes'] ) )…
Change User Role from PHPMYADMIN
To change a WordPress user role in phpMyAdmin, follow these steps:
1. Access phpMyAdmin: Log in to your hosting control panel (like cPanel) and open phpMyAdmin. Select your WordPress database from the left-hand menu.
2. Locate the user: Go to the wp_users table (replace wp_ with your actual table prefix if different) and find the user by their username or ID.
3. Edit the user’s capabilities:
- Navigate to the
wp_usermetatable. - Use the Search function to find the row where
user_idmatches the user’s ID andmeta_keyiswp_capabilities. - Click Edit on that row.
- In the
meta_valuefield, enter the serialized PHP array corresponding to the desired role:- Administrator:
a:1:{s:13:"administrator";b:1;} - Editor:
a:1:{s:6:"editor";b:1;} - Author:
a:1:{s:6:"author";b:1;} - Contributor:
a:1:{s:11:"contributor";b:1;} - Subscriber:
a:1:{s:10:"subscriber";b:1;}
- Administrator:
- Click Go to save.
4. No need to Update „wp_user_level“ (legacy function discontinued)
