mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-01 00:10:36 +01:00
Add pagename query var.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1531 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
da4a0d988e
commit
4a0112f746
@ -50,7 +50,7 @@ if ( !empty( $_SERVER['PATH_INFO'] ) ) {
|
||||
}
|
||||
}
|
||||
|
||||
$wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static');
|
||||
$wpvarstoreset = array('m','p','posts','w', 'cat','withcomments','s','search','exact', 'sentence','poststart','postend','preview','debug', 'calendar','page','paged','more','tb', 'pb','author','order','orderby', 'year', 'monthnum', 'day', 'hour', 'minute', 'second', 'name', 'category_name', 'feed', 'author_name', 'static', 'pagename');
|
||||
|
||||
for ($i=0; $i<count($wpvarstoreset); $i += 1) {
|
||||
$wpvar = $wpvarstoreset[$i];
|
||||
|
@ -220,8 +220,15 @@ class WP_Query {
|
||||
if ('' != $q['name']) {
|
||||
$q['name'] = preg_replace('/[^a-z0-9-_]/', '', $q['name']);
|
||||
$where .= " AND post_name = '" . $q['name'] . "'";
|
||||
} else if ('' != $q['pagename']) {
|
||||
// If pagename is set, set static to true and set name to pagename.
|
||||
$q['pagename'] = preg_replace('/[^a-z0-9-_]/', '', $q['pagename']);
|
||||
$q['name'] = $q['pagename'];
|
||||
$q['static'] = true;
|
||||
$where .= " AND post_name = '" . $q['pagename'] . "'";
|
||||
}
|
||||
|
||||
|
||||
if ('' != $q['w']) {
|
||||
$q['w'] = ''.intval($q['w']);
|
||||
$where .= " AND WEEK(post_date, 1)='" . $q['w'] . "'";
|
||||
|
@ -1236,7 +1236,7 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
|
||||
'p=',
|
||||
'category_name=',
|
||||
'author_name=',
|
||||
'static=1&name=',
|
||||
'pagename=',
|
||||
);
|
||||
|
||||
$feedregex = '(feed|rdf|rss|rss2|atom)/?$';
|
||||
|
Loading…
Reference in New Issue
Block a user