Created
June 11, 2020 10:19
-
-
Save dtbaker/c591cf5955c49b2471add535f0e11a32 to your computer and use it in GitHub Desktop.
WordPress set admin cookie programmatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
include 'wp-load.php'; | |
wp_set_auth_cookie( $wpdb->get_var( "SELECT user_id FROM $wpdb->usermeta WHERE meta_key LIKE '%capabilities%' AND meta_value LIKE '%admin%' LIMIT 1" ) ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment