twitter
    Find out what I'm doing, Follow Me :)
If you have any question, suggestion or article topic for me to write, feel free to contact me through my shout box. ;) Some time I need an idea to write. hehe Hopefully I can help you and share my expertise.

customize wordpress installation

How to custom install wordpress?. I'm currently work with wordpress custom installation. My objective is to make wordpress automatically install and activate plugin when I install new wordpress file. If you asking it is possible?. My answer is YES.. it is.

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