[wp-cvs]
wordpress/wp-includes classes.php, 1.27, 1.28 functions.php,
1.218, 1.219
Ryan Boren
rboren at users.sourceforge.net
Sat Dec 4 00:12:11 UTC 2004
Update of /cvsroot/cafelog/wordpress/wp-includes
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5419/wp-includes
Modified Files:
classes.php functions.php
Log Message:
Improve plugin hooks for rewrite manipulation. Allow pluggable template redirection.
Index: functions.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/functions.php,v
retrieving revision 1.218
retrieving revision 1.219
diff -C2 -d -r1.218 -r1.219
*** functions.php 3 Dec 2004 02:38:11 -0000 1.218
--- functions.php 4 Dec 2004 00:12:08 -0000 1.219
***************
*** 2057,2059 ****
--- 2057,2068 ----
add_query_arg($key, '', $query);
}
+
+ function load_template($file) {
+ global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query,
+ $wp_rewrite, $wpdb;
+
+ extract($wp_query->query_vars);
+
+ include($file);
+ }
?>
Index: classes.php
===================================================================
RCS file: /cvsroot/cafelog/wordpress/wp-includes/classes.php,v
retrieving revision 1.27
retrieving revision 1.28
diff -C2 -d -r1.27 -r1.28
*** classes.php 3 Dec 2004 02:38:11 -0000 1.27
--- classes.php 4 Dec 2004 00:12:08 -0000 1.28
***************
*** 705,711 ****
var $date_structure;
var $front;
! var $prefix = '';
var $index = 'index.php';
var $matches = '';
var $rewritecode =
array(
--- 705,712 ----
var $date_structure;
var $front;
! var $root = '';
var $index = 'index.php';
var $matches = '';
+ var $rules;
var $rewritecode =
array(
***************
*** 877,881 ****
}
! function generate_rewrite_rules($permalink_structure = '', $forcomments = false) {
$feedregex2 = '(feed|rdf|rss|rss2|atom)/?$';
$feedregex = 'feed/' . $feedregex2;
--- 878,888 ----
}
! function add_rewrite_tag($tag, $pattern, $query) {
! $this->rewritecode[] = $tag;
! $this->rewritereplace[] = $pattern;
! $this->queryreplace[] = $query;
! }
!
! function generate_rewrite_rules($permalink_structure = '', $page = true, $feed = true, $forcomments = false) {
$feedregex2 = '(feed|rdf|rss|rss2|atom)/?$';
$feedregex = 'feed/' . $feedregex2;
***************
*** 933,938 ****
$feedquery2 .= '&withcomments=1';
}
!
! $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2, $pagematch => $pagequery);
if ($num_toks) {
--- 940,949 ----
$feedquery2 .= '&withcomments=1';
}
!
! $rewrite = array();
! if ($feed)
! $rewrite = array($feedmatch => $feedquery, $feedmatch2 => $feedquery2);
! if ($page)
! $rewrite = $rewrite + array($pagematch => $pagequery);
if ($num_toks) {
***************
*** 981,991 ****
// Root
! $root_rewrite = $this->generate_rewrite_rules($this->prefix . '/');
// Comments
! $comments_rewrite = $this->generate_rewrite_rules($this->prefix . 'comments', true);
// Search
! $search_structure = $this->prefix . "search/%search%";
$search_rewrite = $this->generate_rewrite_rules($search_structure);
--- 992,1002 ----
// Root
! $root_rewrite = $this->generate_rewrite_rules($this->root . '/');
// Comments
! $comments_rewrite = $this->generate_rewrite_rules($this->root . 'comments',true, true, true);
// Search
! $search_structure = $this->root . "search/%search%";
$search_rewrite = $this->generate_rewrite_rules($search_structure);
***************
*** 1001,1012 ****
// Deprecated style static pages
! $page_structure = $this->prefix . 'site/%pagename%';
$old_page_rewrite = $this->generate_rewrite_rules($page_structure);
// Put them together.
! $this->rewrite = $page_rewrite + $root_rewrite + $comments_rewrite + $old_page_rewrite + $search_rewrite + $category_rewrite + $author_rewrite + $date_rewrite + $post_rewrite;
! $this->rewrite = apply_filters('rewrite_rules_array', $this->rewrite);
! return $this->rewrite;
}
--- 1012,1024 ----
// Deprecated style static pages
! $page_structure = $this->root . 'site/%pagename%';
$old_page_rewrite = $this->generate_rewrite_rules($page_structure);
// Put them together.
! $this->rules = $page_rewrite + $root_rewrite + $comments_rewrite + $old_page_rewrite + $search_rewrite + $category_rewrite + $author_rewrite + $date_rewrite + $post_rewrite;
! do_action('generate_rewrite_rules', '');
! $this->rules = apply_filters('rewrite_rules_array', $this->rules);
! return $this->rules;
}
***************
*** 1030,1034 ****
$this->matches = '';
$rewrite = $this->rewrite_rules();
-
$num_rules = count($rewrite);
$rules .= "RewriteCond %{REQUEST_FILENAME} -f [OR]\n" .
--- 1042,1045 ----
***************
*** 1062,1068 ****
$this->permalink_structure = get_settings('permalink_structure');
$this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%'));
! $this->prefix = '';
if ($this->using_index_permalinks()) {
! $this->prefix = $this->index . '/';
}
$this->category_base = get_settings('category_base');
--- 1073,1079 ----
$this->permalink_structure = get_settings('permalink_structure');
$this->front = substr($this->permalink_structure, 0, strpos($this->permalink_structure, '%'));
! $this->root = '';
if ($this->using_index_permalinks()) {
! $this->root = $this->index . '/';
}
$this->category_base = get_settings('category_base');
More information about the cvs
mailing list