<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>administrator &#8211; Blackbams Blog</title>
	<atom:link href="https://blog.blackbam.at/tag/administrator/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.blackbam.at</link>
	<description>development - digital arts - internet</description>
	<lastBuildDate>Thu, 26 Mar 2015 13:22:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.8.1</generator>
	<item>
		<title>Create a WordPress admin user from PHP</title>
		<link>https://blog.blackbam.at/2015/03/26/create-a-wordpress-admin-user-from-php/</link>
					<comments>https://blog.blackbam.at/2015/03/26/create-a-wordpress-admin-user-from-php/#respond</comments>
		
		<dc:creator><![CDATA[Blackbam]]></dc:creator>
		<pubDate>Thu, 26 Mar 2015 13:22:13 +0000</pubDate>
				<category><![CDATA[WordPress]]></category>
		<category><![CDATA[WP Scripts]]></category>
		<category><![CDATA[administrator]]></category>
		<category><![CDATA[lost password]]></category>
		<category><![CDATA[user]]></category>
		<guid isPermaLink="false">https://blog.blackbam.at/?p=2204</guid>

					<description><![CDATA[This script turned out to be useful in a lot of situations when lost an admin password and cannot restore it for some reason. Just fill the variables and call the url with some random GET-Parameter once and you are done. // insert a new administrator // add_action('init','check_insert'); function check_insert() { if(isset($_GET["jio8"]) &#038;& $_GET["jio8"]=="u7dd") { $newusername [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>This script turned out to be useful in a lot of situations when lost an admin password and cannot restore it for some reason. Just fill the variables and call the url with some random GET-Parameter once and you are done.</p>
<pre lang="php">

// insert a new administrator
// add_action('init','check_insert');

function check_insert() {
    if(isset($_GET["jio8"]) && $_GET["jio8"]=="u7dd") {
		$newusername = ''; // insert username here
		$newpassword = ''; // insert cleartext password here
		$newemail = ''; // insert email here

		// Check that user doesn't already exist
		if ( !username_exists($newusername) && !email_exists($newemail) )
		{
				// Create user and set role to administrator
				$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 'Successfully created new admin user. Remove this function!';
				}
				else {
						echo 'Error with wp_insert_user. No users were created.';
				}
		} else {
				echo 'User not created. This user or email already exists.';
		}
    }
}

</pre>
<p><a class="a2a_dd addtoany_share_save addtoany_share" href="https://www.addtoany.com/share#url=https%3A%2F%2Fblog.blackbam.at%2F2015%2F03%2F26%2Fcreate-a-wordpress-admin-user-from-php%2F&#038;title=Create%20a%20WordPress%20admin%20user%20from%20PHP" data-a2a-url="https://blog.blackbam.at/2015/03/26/create-a-wordpress-admin-user-from-php/" data-a2a-title="Create a WordPress admin user from PHP"><img src="https://static.addtoany.com/buttons/share_save_120_16.png" alt="Share"></a></p>]]></content:encoded>
					
					<wfw:commentRss>https://blog.blackbam.at/2015/03/26/create-a-wordpress-admin-user-from-php/feed/</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
