Changeset 902 for trunk/wp-includes/functions.php
- Timestamp:
- 02/21/2004 02:10:07 PM (21 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r892 r902 1470 1470 } 1471 1471 1472 function get_posts($args) { 1473 global $wpdb, $tableposts; 1474 parse_str($args, $r); 1475 if (!isset($r['numberposts'])) $r['numberposts'] = 5; 1476 if (!isset($r['offset'])) $r['offset'] = 0; 1477 // The following not implemented yet 1478 if (!isset($r['category'])) $r['category'] = ''; 1479 if (!isset($r['orderby'])) $r['orderby'] = ''; 1480 if (!isset($r['order'])) $r['order'] = ''; 1481 1482 $now = current_time('mysql'); 1483 1484 $posts = $wpdb->get_results("SELECT DISTINCT * FROM $tableposts WHERE post_date <= '$now' AND (post_status = 'publish') GROUP BY $tableposts.ID ORDER BY post_date DESC LIMIT " . $r['offset'] . ',' . $r['numberposts']); 1485 1486 return $posts; 1487 } 1488 1472 1489 ?>
Note: See TracChangeset
for help on using the changeset viewer.