How to create custom wordpress installation?
1. If you install wordpress file, by default wordpress will execute install.php under wp-admin/install.php and then execute upgrade.php under wp-admin/includes/upgrade.php
2. open upgrade.php file and you can see at line 11.
/** Include user install customize script. */ if ( file_exists(WP_CONTENT_DIR . '/install.php') ) require (WP_CONTENT_DIR . '/install.php');
the script will check whether there is install.php file in the wp-content/ . If have, it will execute this script first.
3. to use custom script, you need to create install.php file in the wp-content/install.php
4. you may create wp_install() function inside wp-content/install.php to override n wp_install() at wp-admin/includes/upgrade.php . you can add whatever you want like automatically install/activate plugin, change default theme etc here without make any changes at original upgrade.php code.
0 comments:
Post a Comment