Skip to content

Instantly share code, notes, and snippets.

@trueqap
Last active January 26, 2018 05:26
Show Gist options
  • Save trueqap/38268cde77c92d5cb9b8c37dd4346704 to your computer and use it in GitHub Desktop.
Save trueqap/38268cde77c92d5cb9b8c37dd4346704 to your computer and use it in GitHub Desktop.
<?php
//Részletek itt: https://wphu.org/tippek-trukkok/hogyan-jussunk-wordpress-adminba-hozzaferes-nelkul/
require_once('wp-blog-header.php');
require_once('wp-includes/registration.php');
$newusername = 'wphu.org-potkulcs';
$newpassword = 'wphu.org-potjelszo';
$newemail = 'wphu@org.potjelszo';
if ( !username_exists($newusername) && !email_exists($newemail) )
{
$user_id = wp_create_user( $newusername, $newpassword, $newemail);
if ( is_int($user_id) )
{
$wp_user_object = new WP_User($user_id);
$wp_user_object->set_role('administrator');
echo 'Sikeresen elkeszult a pothozzaferes! Most torolheted a potkulcs.php-t!';
}
else {
echo 'Hiba! sajnos nem tudtuk letrehozni a pothozzaferest.';
}
}
else {
echo 'Ez az emailcim mar regisztralva van.';
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment