Skip to content

Instantly share code, notes, and snippets.

@phillcoxon
Forked from Steveorevo/install.php
Last active December 30, 2015 02:39
Show Gist options
  • Save phillcoxon/7764621 to your computer and use it in GitHub Desktop.
Save phillcoxon/7764621 to your computer and use it in GitHub Desktop.
WordPress install.php dropin example
<?php
echo 'This has been customized!!!';
// Perform post-install customizations
if ( function_exists( 'add_action' ) ){
add_action( 'wp_mail_content_type' , customize_install );
function customize_install(){
// Switch themes
switch_theme('twentytwelve');
// Default the timezone
update_option( 'timezone_string', 'Pacific/Auckland' );
// Increase the Size of the Post Editor
update_option( 'default_post_edit_rows', 40 );
// Remove Hello Dolly
delete_plugins( array('hello.php') );
// Remove default hello world post
wp_delete_post(1,true);
// Remove default sample page
wp_delete_post(2,true);
// Remove default Mr.Wordpress comment
wp_delete_comment( 1, true ) ;
// Activate Akismet
activate_plugin( WP_PLUGIN_DIR . '/akismet/akismet.php' );
// Update Permalinks
update_option( 'selection','custom' );
update_option( 'permalink_structure','/%post_id%/%postname%/' );
global $wp_rewrite;
$wp_rewrite->flush_rules();
// Prevent new website notice
global $phpmailer;
$phpmailer = new PHPMailer(); // reset
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment