Integration wp-config file in Wordpress for switch environment: local, staging and production development.
- Copy repository on Wordpress root.
git clone https://github.com/ffranz/wp-config.git- Replace
DEFINEvariables inwp-config.phpwith this:
require('wp-config/wp-environments.php');- Change variable on
.local,.stagingand.productionfile.
define('DB_NAME', 'database_name_here');
define('DB_USER', 'username_here');
define('DB_PASSWORD', 'password_here');
define('DB_HOST', 'localhost');
define('DB_CHARSET', 'utf8');
define('DB_COLLATE', '');- Enjoy!