mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 09:37:42 +01:00
Copy searchform and images when creating site theme from default theme. http://mosquito.wordpress.org/view.php?id=852
git-svn-id: http://svn.automattic.com/wordpress/trunk@2293 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
e509af852c
commit
5e68548c89
@ -593,13 +593,17 @@ function make_site_theme_from_default($theme_name, $template) {
|
|||||||
$default_dir = ABSPATH . 'wp-content/themes/default';
|
$default_dir = ABSPATH . 'wp-content/themes/default';
|
||||||
|
|
||||||
// Copy files from the default theme to the site theme.
|
// Copy files from the default theme to the site theme.
|
||||||
$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
|
//$files = array('index.php', 'comments.php', 'comments-popup.php', 'footer.php', 'header.php', 'sidebar.php', 'style.css');
|
||||||
|
|
||||||
foreach ($files as $file) {
|
$theme_dir = @ dir("$default_dir");
|
||||||
if (! @copy("$default_dir/$file", "$site_dir/$file"))
|
if ($theme_dir) {
|
||||||
|
while(($theme_file = $theme_dir->read()) !== false) {
|
||||||
|
if (is_dir("$default_dir/$theme_file"))
|
||||||
|
continue;
|
||||||
|
if (! @copy("$default_dir/$theme_file", "$site_dir/$theme_file"))
|
||||||
return;
|
return;
|
||||||
|
chmod("$site_dir/$theme_file", 0777);
|
||||||
chmod("$site_dir/$file", 0777);
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Rewrite the theme header.
|
// Rewrite the theme header.
|
||||||
@ -617,6 +621,23 @@ function make_site_theme_from_default($theme_name, $template) {
|
|||||||
}
|
}
|
||||||
fclose($f);
|
fclose($f);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Copy the images.
|
||||||
|
umask(0);
|
||||||
|
if (! mkdir("$site_dir/images", 0777)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$images_dir = @ dir("$default_dir/images");
|
||||||
|
if ($images_dir) {
|
||||||
|
while(($image = $images_dir->read()) !== false) {
|
||||||
|
if (is_dir("$default_dir/images/$image"))
|
||||||
|
continue;
|
||||||
|
if (! @copy("$default_dir/images/$image", "$site_dir/images/$image"))
|
||||||
|
return;
|
||||||
|
chmod("$site_dir/images/$image", 0777);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Create a site theme from the default theme.
|
// Create a site theme from the default theme.
|
||||||
|
Loading…
Reference in New Issue
Block a user