Skip to content

Instantly share code, notes, and snippets.

@swalkinshaw
Created August 31, 2013 21:22
Show Gist options
  • Star 6 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save swalkinshaw/6400708 to your computer and use it in GitHub Desktop.
Save swalkinshaw/6400708 to your computer and use it in GitHub Desktop.
<?php
if (!is_blog_installed()) { return; }
if ('http://' . $_SERVER['SERVER_NAME'] . '/wp' == get_option('home')) {
update_option('siteurl', 'http://' . $_SERVER['SERVER_NAME'] . '/wp');
update_option('home', 'http://' . $_SERVER['SERVER_NAME']);
update_option('upload_path', $_SERVER['DOCUMENT_ROOT'] . '/media');
update_option('upload_url_path', 'http://' . $_SERVER['SERVER_NAME'] . '/media');
update_option('permalink_structure', '/%postname%/');
}
if (defined('FRONT_PAGE') && defined('POSTS_PAGE') && !get_option('page_on_front')) {
$front = get_page_by_title(FRONT_PAGE);
$posts = get_page_by_title(POSTS_PAGE);
if ($front && $posts) {
update_option('show_on_front', 'page');
update_option('page_on_front', $front->ID);
update_option('page_for_posts', $posts->ID);
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment