Skip to content

Instantly share code, notes, and snippets.

@kfriend
Created July 28, 2016 13:14
Show Gist options
  • Save kfriend/6554c83512913ec4086955881b3f3dfe to your computer and use it in GitHub Desktop.
Save kfriend/6554c83512913ec4086955881b3f3dfe to your computer and use it in GitHub Desktop.
Generate PHP Dotenv vars for Wordpress's hashes and keys
php -r 'eval(file_get_contents("https://api.wordpress.org/secret-key/1.1/salt/"));foreach(explode(" ","AUTH_KEY AUTH_SALT LOGGED_IN_KEY LOGGED_IN_SALT NONCE_KEY NONCE_SALT SECURE_AUTH_KEY SECURE_AUTH_SALT")as$n){echo "WP_{$n} = '\''".constant($n)."'\''".PHP_EOL;}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment