Changeset 640
- Timestamp:
- 12/22/2003 11:00:45 PM (22 years ago)
- Location:
- trunk
- Files:
-
- 3 edited
-
wp-admin/options-permalink.php (modified) (3 diffs)
-
wp-includes/functions.php (modified) (4 diffs)
-
wp-includes/template-functions.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/options-permalink.php
r628 r640 105 105 '%monthnum%', 106 106 '%day%', 107 '%postname%' 107 '%postname%', 108 '%post_id%' 108 109 ); 109 110 $rewritereplace = array( … … 111 112 '([0-9]{1,2})?', 112 113 '([0-9]{1,2})?', 113 '([0-9a-z-]+)?' 114 '([0-9a-z-]+)?', 115 '([0-9]+)?' 114 116 ); 115 117 $queryreplace = array ( … … 117 119 'monthnum=', 118 120 'day=', 119 'name=' 121 'name=', 122 'p=' 120 123 ); 121 124 -
trunk/wp-includes/functions.php
r638 r640 494 494 '%monthnum%', 495 495 '%day%', 496 '%postname%' 496 '%postname%', 497 '%post_id%' 497 498 ); 498 499 $rewritereplace = array( … … 500 501 '([0-9]{1,2})?', 501 502 '([0-9]{1,2})?', 502 '([0-9a-z-]+)?' 503 '([0-9a-z-]+)?', 504 '([0-9]+)?' 503 505 ); 504 506 … … 517 519 $value = $values[$i+1]; 518 520 519 // Create a variable named $year, $monthnum, $day, or $postname:521 // Create a variable named $year, $monthnum, $day, $postname, or $post_id: 520 522 $$name = $value; 521 523 } 522 524 523 // Build a WHERE clause, making the values safe along the way: 525 // If using %post_id%, we're done: 526 if (intval($post_id)) return intval($post_id); 527 528 // Otherwise, build a WHERE clause, making the values safe along the way: 524 529 if ($year) $where .= " AND YEAR(post_date) = " . intval($year); 525 530 if ($monthnum) $where .= " AND MONTH(post_date) = " . intval($monthnum); … … 528 533 529 534 // Run the query to get the post ID: 530 return intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where)); 535 $id = intval($wpdb->get_var("SELECT ID FROM $tableposts WHERE 1 = 1 " . $where)); 536 537 return $id; 531 538 } 532 539 -
trunk/wp-includes/template-functions.php
r634 r640 420 420 date('n', $unixtime), 421 421 date('j', $unixtime), 422 $post->post_name 422 $post->post_name, 423 $post->ID 423 424 ); 424 425 return $siteurl . str_replace($rewritecode, $rewritereplace, get_settings('permalink_structure'));
Note: See TracChangeset
for help on using the changeset viewer.