Changeset 640 for trunk/wp-includes/functions.php
- Timestamp:
- 12/22/2003 11:00:45 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
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
Note: See TracChangeset
for help on using the changeset viewer.