mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Add pagename query var.
git-svn-id: https://develop.svn.wordpress.org/trunk@1531 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -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'] . "'";
|
||||
|
||||
@@ -1204,8 +1204,8 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
|
||||
'%second%',
|
||||
'%postname%',
|
||||
'%post_id%',
|
||||
'%category%',
|
||||
'%author%',
|
||||
'%category%',
|
||||
'%author%',
|
||||
'%pagename%'
|
||||
);
|
||||
|
||||
@@ -1234,9 +1234,9 @@ function generate_rewrite_rules($permalink_structure = '', $matches = '') {
|
||||
'second=',
|
||||
'name=',
|
||||
'p=',
|
||||
'category_name=',
|
||||
'author_name=',
|
||||
'static=1&name=',
|
||||
'category_name=',
|
||||
'author_name=',
|
||||
'pagename=',
|
||||
);
|
||||
|
||||
$feedregex = '(feed|rdf|rss|rss2|atom)/?$';
|
||||
|
||||
@@ -34,9 +34,9 @@ function get_permalink($id=false) {
|
||||
'%year%',
|
||||
'%monthnum%',
|
||||
'%day%',
|
||||
'%hour%',
|
||||
'%minute%',
|
||||
'%second%',
|
||||
'%hour%',
|
||||
'%minute%',
|
||||
'%second%',
|
||||
'%postname%',
|
||||
'%post_id%',
|
||||
'%category%',
|
||||
|
||||
Reference in New Issue
Block a user