Changeset 6364 for trunk/wp-includes/post.php
- Timestamp:
- 12/06/2007 07:49:33 PM (18 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/post.php (modified) (16 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/post.php
r6351 r6364 27 27 28 28 function &get_children($args = '', $output = OBJECT) { 29 global $wpdb;30 31 29 if ( empty( $args ) ) { 32 30 if ( isset( $GLOBALS['post'] ) ) { … … 164 162 165 163 function get_post_type($post = false) { 166 global $ wpdb, $posts;164 global $posts; 167 165 168 166 if ( false === $post ) … … 311 309 312 310 function get_post_meta($post_id, $key, $single = false) { 313 global $wpdb;314 315 311 $post_id = (int) $post_id; 316 312 … … 343 339 global $wpdb; 344 340 345 $original_value = $meta_value;346 341 $meta_value = maybe_serialize($meta_value); 347 348 $original_prev = $prev_value;349 342 $prev_value = maybe_serialize($prev_value); 350 343 … … 379 372 380 373 function get_post_custom($post_id = 0) { 381 global $id , $wpdb;374 global $id; 382 375 383 376 if ( !$post_id ) … … 578 571 579 572 function wp_get_single_post($postid = 0, $mode = OBJECT) { 580 global $wpdb;581 582 573 $postid = (int) $postid; 583 574 … … 598 589 599 590 function wp_insert_post($postarr = array()) { 600 global $wpdb, $wp_rewrite, $ allowedtags, $user_ID;591 global $wpdb, $wp_rewrite, $user_ID; 601 592 602 593 $defaults = array('post_status' => 'draft', 'post_type' => 'post', 'post_author' => $user_ID, … … 769 760 770 761 function wp_update_post($postarr = array()) { 771 global $wpdb;772 773 762 if ( is_object($postarr) ) 774 763 $postarr = get_object_vars($postarr); … … 836 825 function wp_set_post_tags( $post_id = 0, $tags = '', $append = false ) { 837 826 /* $append - true = don't delete existing tags, just add on, false = replace the tags with the new tags */ 838 global $wpdb;839 827 840 828 $post_id = (int) $post_id; … … 850 838 851 839 function wp_set_post_categories($post_ID = 0, $post_categories = array()) { 852 global $wpdb;853 854 840 $post_ID = (int) $post_ID; 855 841 // If $post_categories isn't already an array, make it one: … … 891 877 892 878 function get_enclosed($post_id) { // Get enclosures already enclosed for a post 893 global $wpdb;894 879 $custom_fields = get_post_custom( $post_id ); 895 880 $pung = array(); … … 1227 1212 1228 1213 // expected_slashed ($post_name) 1229 $post_name_check = 1230 $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_status = 'inherit' AND ID != %d LIMIT 1", $post_ID)); 1214 $post_name_check = $wpdb->get_var( $wpdb->prepare( "SELECT post_name FROM $wpdb->posts WHERE post_name = '$post_name' AND post_status = 'inherit' AND ID != %d LIMIT 1", $post_ID)); 1231 1215 1232 1216 if ($post_name_check) { … … 1548 1532 1549 1533 function get_lastpostdate($timezone = 'server') { 1550 global $cache_lastpostdate, $pagenow, $wpdb, $blog_id; 1551 $add_seconds_blog = get_option('gmt_offset') * 3600; 1534 global $cache_lastpostdate, $wpdb, $blog_id; 1552 1535 $add_seconds_server = date('Z'); 1553 1536 if ( !isset($cache_lastpostdate[$blog_id][$timezone]) ) { … … 1571 1554 1572 1555 function get_lastpostmodified($timezone = 'server') { 1573 global $cache_lastpostmodified, $pagenow, $wpdb, $blog_id; 1574 $add_seconds_blog = get_option('gmt_offset') * 3600; 1556 global $cache_lastpostmodified, $wpdb, $blog_id; 1575 1557 $add_seconds_server = date('Z'); 1576 1558 if ( !isset($cache_lastpostmodified[$blog_id][$timezone]) ) { … … 1634 1616 1635 1617 function update_post_caches(&$posts) { 1636 global $wpdb;1637 1638 1618 // No point in doing all this work if we didn't match any posts. 1639 1619 if ( !$posts ) … … 1739 1719 return; 1740 1720 1741 $post = get_post($post_id);1742 1743 1721 $data = array( 'post_id' => $post_id, 'meta_value' => '1' ); 1744 1722 if ( get_option('default_pingback_flag') )
Note: See TracChangeset
for help on using the changeset viewer.