Skip to content

Instantly share code, notes, and snippets.

@jamesmorrison
Last active June 10, 2016 13:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesmorrison/590baa3b878a50efd37660ae867f4c09 to your computer and use it in GitHub Desktop.
Save jamesmorrison/590baa3b878a50efd37660ae867f4c09 to your computer and use it in GitHub Desktop.
Custom WordPress install script - add to /wp-content/install.php before running the installer
<?php
/**
* Creates the initial content for a newly-installed site.
*
* Adds sensible defaults for a new install
*
* @param int $user_id User ID.
*/
function wp_install_defaults( $user_id ) {
/** Blog Description: "" **/
update_option( 'blogdescription', '' );
/** Mailserver: Clear content **/
update_option( 'mailserver_url', '' );
update_option( 'mailserver_login', '' );
update_option( 'mailserver_pass', '' );
update_option( 'mailserver_port', '' );
/** Date format: "23rd November, 2014" */
update_option( 'date_format', 'jS F, Y' );
/** Time zone: "London" */
update_option( 'timezone_string', 'Europe/London' );
/** Permalink Structure **/
update_option( 'permalink_structure', '/%postname%/' );
/** Ping sites **/
update_option( 'ping_sites', '' );
/** Don't show the Welcome Panel **/
update_user_meta( $user_id, 'show_welcome_panel', 0 );
/** Set the default image link to none **/
update_option( 'image_default_link_type', 'none' );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment