Skip to content

Commit 4b217b7

Browse files
committed
Relocate default theme to themes/default. Remove special casing of default theme. Do not look directly in wp-content/ for default theme files. Simplify, simplify.
git-svn-id: https://develop.svn.wordpress.org/trunk@2032 602fd350-edb4-49c9-b593-d223f7449a82
1 parent 824519a commit 4b217b7

10 files changed

Lines changed: 66 additions & 116 deletions

File tree

index.php

Lines changed: 1 addition & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,4 @@
11
<?php
22
/* Don't remove this line. */
33
require('./wp-blog-header.php');
4-
get_header();
5-
?>
6-
7-
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
8-
9-
<?php the_date('','<h2>','</h2>'); ?>
10-
11-
<div class="post">
12-
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
13-
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
14-
15-
<div class="storycontent">
16-
<?php the_content(__('(more...)')); ?>
17-
</div>
18-
19-
<div class="feedback">
20-
<?php wp_link_pages(); ?>
21-
<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
22-
</div>
23-
24-
<!--
25-
<?php trackback_rdf(); ?>
26-
-->
27-
28-
</div>
29-
30-
<?php comments_template( is_single() ); // Get wp-comments.php template ?>
31-
32-
<?php endwhile; else: ?>
33-
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
34-
<?php endif; ?>
35-
36-
<?php posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
37-
38-
<?php get_footer(); ?>
4+
?>
File renamed without changes.
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
<?php
2+
get_header();
3+
?>
4+
5+
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
6+
7+
<?php the_date('','<h2>','</h2>'); ?>
8+
9+
<div class="post">
10+
<h3 class="storytitle" id="post-<?php the_ID(); ?>"><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></h3>
11+
<div class="meta"><?php _e("Filed under:"); ?> <?php the_category(',') ?> &#8212; <?php the_author() ?> @ <?php the_time() ?> <?php edit_post_link(__('Edit This')); ?></div>
12+
13+
<div class="storycontent">
14+
<?php the_content(__('(more...)')); ?>
15+
</div>
16+
17+
<div class="feedback">
18+
<?php wp_link_pages(); ?>
19+
<?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
20+
</div>
21+
22+
<!--
23+
<?php trackback_rdf(); ?>
24+
-->
25+
26+
</div>
27+
28+
<?php comments_template( is_single() ); // Get wp-comments.php template ?>
29+
30+
<?php endwhile; else: ?>
31+
<p><?php _e('Sorry, no posts matched your criteria.'); ?></p>
32+
<?php endif; ?>
33+
34+
<?php posts_nav_link(' &#8212; ', __('&laquo; Previous Page'), __('Next Page &raquo;')); ?>
35+
36+
<?php get_footer(); ?>
Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
1-
/* Default WordPress by Dave Shea || http://mezzoblue.com
2-
Modifications by Matthew Mullenweg || http://photomatt.net
3-
This is just a basic layout, with only the bare minimum defined.
4-
Please tweak this and make it your own. :)
1+
/*
2+
Theme Name: Default
3+
Theme URI: http://wordpress.org/
4+
Description: The default theme included with WordPress.
5+
Version: 1.5
6+
Author: Dave Shea
7+
8+
Default WordPress by Dave Shea || http://mezzoblue.com
9+
Modifications by Matthew Mullenweg || http://photomatt.net
10+
This is just a basic layout, with only the bare minimum defined.
11+
Please tweak this and make it your own. :)
512
*/
613

714
a {

wp-includes/functions.php

Lines changed: 12 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1253,11 +1253,7 @@ function get_template() {
12531253
function get_template_directory() {
12541254
$template = get_template();
12551255

1256-
if (empty($template) || $template == 'default') {
1257-
$template = ABSPATH . "wp-content";
1258-
} else {
1259-
$template = ABSPATH . "wp-content/themes/$template";
1260-
}
1256+
$template = ABSPATH . "wp-content/themes/$template";
12611257

12621258
return $template;
12631259
}
@@ -1330,41 +1326,6 @@ function get_themes() {
13301326
}
13311327
}
13321328

1333-
$default_files = array('wp-comments.php', 'wp-comments-popup.php', 'wp-comments-post.php', 'wp-footer.php', 'wp-header.php', 'wp-sidebar.php', 'footer.php', 'header.php', 'sidebar.php');
1334-
1335-
// Get the files for the default template.
1336-
$default_template_files = array();
1337-
{
1338-
// Find the index.
1339-
if (file_exists(ABSPATH .'wp-content/index.php')) {
1340-
$default_template_files[] = 'wp-content/index.php';
1341-
} else {
1342-
$default_template_files[] = 'index.php';
1343-
}
1344-
1345-
$dirs = array('', 'wp-content');
1346-
foreach ($dirs as $dir) {
1347-
$template_dir = @ dir(ABSPATH . $dir);
1348-
while(($file = $template_dir->read()) !== false) {
1349-
if ( !preg_match('|^\.+$|', $file) && in_array($file, $default_files))
1350-
$default_template_files[] = trim("$dir/$file", '/');
1351-
}
1352-
}
1353-
}
1354-
1355-
// Get the files for the default stylesheet.
1356-
$default_stylesheet_files = array();
1357-
{
1358-
$stylesheet_dir = @ dir(ABSPATH);
1359-
while(($file = $stylesheet_dir->read()) !== false) {
1360-
if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file))
1361-
$default_stylesheet_files[] = "$file";
1362-
}
1363-
}
1364-
1365-
// The default theme always exists.
1366-
$themes['Default'] = array('Name' => 'Default', 'Title' => 'WordPress Default', 'Description' => 'The default theme included with WordPress.', 'Author' => 'Dave Shea', 'Version' => '1.3', 'Template' => 'default', 'Stylesheet' => 'default', 'Template Files' => $default_template_files, 'Stylesheet Files' => $default_stylesheet_files, 'Template Dir' => '/', 'Stylesheet Dir' => '/', 'Parent Theme' => '');
1367-
13681329
if (!$themes_dir || !$theme_files) {
13691330
return $themes;
13701331
}
@@ -1397,35 +1358,27 @@ function get_themes() {
13971358

13981359
$template = trim($template);
13991360

1400-
if (($template != 'default') && (! file_exists("$theme_root/$template/index.php"))) {
1361+
if (! file_exists("$theme_root/$template/index.php")) {
14011362
$wp_broken_themes[$name] = array('Name' => $name, 'Title' => $title, 'Description' => __('Template is missing.'));
14021363
continue;
14031364
}
14041365

14051366
$stylesheet_files = array();
1406-
if ($stylesheet != 'default') {
1407-
$stylesheet_dir = @ dir("$theme_root/$stylesheet");
1408-
if ($stylesheet_dir) {
1409-
while(($file = $stylesheet_dir->read()) !== false) {
1410-
if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) )
1411-
$stylesheet_files[] = "$theme_loc/$stylesheet/$file";
1412-
}
1367+
$stylesheet_dir = @ dir("$theme_root/$stylesheet");
1368+
if ($stylesheet_dir) {
1369+
while(($file = $stylesheet_dir->read()) !== false) {
1370+
if ( !preg_match('|^\.+$|', $file) && preg_match('|\.css$|', $file) )
1371+
$stylesheet_files[] = "$theme_loc/$stylesheet/$file";
14131372
}
1414-
} else {
1415-
$stylesheet_files = $default_stylesheet_files;
14161373
}
14171374

14181375
$template_files = array();
1419-
if ($template != 'default') {
1420-
$template_dir = @ dir("$theme_root/$template");
1421-
if ($template_dir) {
1422-
while(($file = $template_dir->read()) !== false) {
1423-
if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) )
1424-
$template_files[] = "$theme_loc/$template/$file";
1425-
}
1376+
$template_dir = @ dir("$theme_root/$template");
1377+
if ($template_dir) {
1378+
while(($file = $template_dir->read()) !== false) {
1379+
if ( !preg_match('|^\.+$|', $file) && preg_match('|\.php$|', $file) )
1380+
$template_files[] = "$theme_loc/$template/$file";
14261381
}
1427-
} else {
1428-
$template_files = $default_template_files;
14291382
}
14301383

14311384
$template_dir = dirname($template_files[0]);

wp-includes/template-functions-general.php

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -6,21 +6,21 @@ function get_header() {
66
if ( file_exists( TEMPLATEPATH . '/header.php') )
77
load_template( TEMPLATEPATH . '/header.php');
88
else
9-
load_template( ABSPATH . 'wp-includes/wp-header.php');
9+
load_template( ABSPATH . 'wp-content/themes/default/header.php');
1010
}
1111

1212
function get_footer() {
1313
if ( file_exists( TEMPLATEPATH . '/footer.php') )
1414
load_template( TEMPLATEPATH . '/footer.php');
1515
else
16-
load_template( ABSPATH . 'wp-includes/wp-footer.php');
16+
load_template( ABSPATH . 'wp-content/themes/default/footer.php');
1717
}
1818

1919
function get_sidebar() {
2020
if ( file_exists( TEMPLATEPATH . '/sidebar.php') )
2121
load_template( TEMPLATEPATH . '/sidebar.php');
2222
else
23-
load_template( ABSPATH . 'wp-includes/wp-sidebar.php');
23+
load_template( ABSPATH . 'wp-content/themes/default/sidebar.php');
2424
}
2525

2626

@@ -105,28 +105,16 @@ function get_bloginfo($show='') {
105105
break;
106106
case 'stylesheet_url':
107107
$output = get_stylesheet();
108-
if (empty($output) || $output == 'default') {
109-
$output = get_settings('siteurl') . "/wp-includes/wp-layout.css";
110-
} else {
111-
$output = get_settings('siteurl') . "/wp-content/themes/$output/style.css";
112-
}
108+
$output = get_settings('siteurl') . "/wp-content/themes/$output/style.css";
113109
break;
114110
case 'stylesheet_directory':
115111
$output = get_stylesheet();
116-
if (empty($output) || $output == 'default') {
117-
$output = get_settings('siteurl');
118-
} else {
119-
$output = get_settings('siteurl') . "/wp-content/themes/$output";
120-
}
112+
$output = get_settings('siteurl') . "/wp-content/themes/$output";
121113
break;
122114
case 'template_directory':
123115
case 'template_url':
124116
$output = get_template();
125-
if (empty($output) || $output == 'default') {
126-
$output = get_settings('siteurl');
127-
} else {
128-
$output = get_settings('siteurl') . "/wp-content/themes/$output";
129-
}
117+
$output = get_settings('siteurl') . "/wp-content/themes/$output";
130118
break;
131119
case 'admin_email':
132120
$output = get_settings('admin_email');

0 commit comments

Comments
 (0)