Changeset 6364
- Timestamp:
- 12/06/07 19:49:33 (8 months ago)
- Files:
-
- trunk/wp-app.php (modified) (19 diffs)
- trunk/wp-includes/author-template.php (modified) (1 diff)
- trunk/wp-includes/canonical.php (modified) (2 diffs)
- trunk/wp-includes/capabilities.php (modified) (1 diff)
- trunk/wp-includes/category-template.php (modified) (2 diffs)
- trunk/wp-includes/category.php (modified) (4 diffs)
- trunk/wp-includes/comment-template.php (modified) (6 diffs)
- trunk/wp-includes/comment.php (modified) (5 diffs)
- trunk/wp-includes/feed.php (modified) (7 diffs)
- trunk/wp-includes/formatting.php (modified) (4 diffs)
- trunk/wp-includes/functions.php (modified) (7 diffs)
- trunk/wp-includes/general-template.php (modified) (8 diffs)
- trunk/wp-includes/l10n.php (modified) (1 diff)
- trunk/wp-includes/link-template.php (modified) (4 diffs)
- trunk/wp-includes/pluggable.php (modified) (1 diff)
- trunk/wp-includes/post-template.php (modified) (5 diffs)
- trunk/wp-includes/post.php (modified) (16 diffs)
- trunk/wp-includes/query.php (modified) (4 diffs)
- trunk/wp-includes/rewrite.php (modified) (1 diff)
- trunk/wp-includes/taxonomy.php (modified) (3 diffs)
- trunk/wp-includes/theme.php (modified) (1 diff)
- trunk/wp-includes/user.php (modified) (2 diffs)
- trunk/wp-includes/widgets.php (modified) (5 diffs)
- trunk/wp-login.php (modified) (1 diff)
- trunk/xmlrpc.php (modified) (22 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/wp-app.php
r6339 r6364 216 216 */ 217 217 function create_post() { 218 global $blog_id, $ wpdb;218 global $blog_id, $user_ID; 219 219 $this->get_accepted_content_type($this->atom_content_types); 220 220 … … 250 250 $blog_ID = (int ) $blog_id; 251 251 $post_status = ($publish) ? 'publish' : 'draft'; 252 $post_author = (int) $user ->ID;252 $post_author = (int) $user_ID; 253 253 $post_title = $entry->title[1]; 254 254 $post_content = $entry->content[1]; … … 270 270 $this->internal_error($postID->get_error_message()); 271 271 272 if (!$postID) {272 if (!$postID) 273 273 $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); 274 }275 274 276 275 // getting warning here about unable to set headers … … 297 296 298 297 function put_post($postID) { 299 global $wpdb;300 301 298 // checked for valid content-types (atom+xml) 302 299 // quick check and exit … … 314 311 // check for not found 315 312 global $entry; 316 $entry = $GLOBALS['entry'];317 313 $this->set_current_entry($postID); 318 314 … … 377 373 378 374 function get_attachment($postID = NULL) { 379 380 global $entry;381 375 if (!isset($postID)) { 382 376 $this->get_attachments(); … … 390 384 391 385 function create_attachment() { 392 global $wp, $wpdb, $wp_query, $blog_id;393 386 394 387 $type = $this->get_accepted_content_type(); … … 419 412 $url = $file['url']; 420 413 $file = $file['file']; 421 $filename = basename($file); 422 423 $header = apply_filters('wp_create_file_in_uploads', $file); // replicate 414 415 apply_filters('wp_create_file_in_uploads', $file); // replicate 424 416 425 417 // Construct the attachment array … … 434 426 435 427 // Save the data 436 $postID = wp_insert_attachment($attachment, $file , $post);437 438 if (!$postID) {428 $postID = wp_insert_attachment($attachment, $file); 429 430 if (!$postID) 439 431 $this->internal_error(__('Sorry, your entry could not be posted. Something wrong happened.')); 440 }441 432 442 433 $output = $this->get_entry($postID, 'attachment'); … … 447 438 448 439 function put_attachment($postID) { 449 global $wpdb;450 451 440 // checked for valid content-types (atom+xml) 452 441 // quick check and exit … … 467 456 $this->auth_required(__('Sorry, you do not have the right to edit this post.')); 468 457 469 $publish = (isset($parsed->draft) && trim($parsed->draft) == 'yes') ? false : true;470 471 458 extract($entry); 472 459 … … 546 533 547 534 function put_file($postID) { 548 549 $type = $this->get_accepted_content_type();550 535 551 536 // first check if user can upload … … 606 591 607 592 function the_entries_url($page = NULL) { 608 $url = $this->get_entries_url($page); 609 echo $url; 610 } 611 612 function get_categories_url($page = NULL) { 593 echo $this->get_entries_url($page); 594 } 595 596 function get_categories_url($deprecated = '') { 613 597 return $this->app_base . $this->CATEGORIES_PATH; 614 598 } 615 599 616 600 function the_categories_url() { 617 $url = $this->get_categories_url(); 618 echo $url; 601 echo $this->get_categories_url(); 619 602 } 620 603 … … 628 611 629 612 function the_attachments_url($page = NULL) { 630 $url = $this->get_attachments_url($page); 631 echo $url; 613 echo $this->get_attachments_url($page); 632 614 } 633 615 … … 639 621 if(!isset($postID)) { 640 622 global $post; 641 $postID = (int) $ GLOBALS['post']->ID;623 $postID = (int) $post->ID; 642 624 } 643 625 … … 649 631 650 632 function the_entry_url($postID = NULL) { 651 $url = $this->get_entry_url($postID); 652 echo $url; 633 echo $this->get_entry_url($postID); 653 634 } 654 635 … … 656 637 if(!isset($postID)) { 657 638 global $post; 658 $postID = (int) $ GLOBALS['post']->ID;639 $postID = (int) $post->ID; 659 640 } 660 641 … … 666 647 667 648 function the_media_url($postID = NULL) { 668 $url = $this->get_media_url($postID); 669 echo $url; 649 echo $this->get_media_url($postID); 670 650 } 671 651 … … 760 740 log_app('function',"get_entry($postID, '$post_type')"); 761 741 ob_start(); 762 global $posts, $post, $wp_query, $wp, $wpdb, $blog_id;763 742 switch($post_type) { 764 743 case 'post': trunk/wp-includes/author-template.php
r6026 r6364 317 317 */ 318 318 function get_author_posts_url($author_id, $author_nicename = '') { 319 global $wp db, $wp_rewrite, $post;319 global $wp_rewrite; 320 320 $auth_ID = (int) $author_id; 321 321 $link = $wp_rewrite->get_author_permastruct(); trunk/wp-includes/canonical.php
r6263 r6364 3 3 4 4 function redirect_canonical($requested_url=NULL, $do_redirect=true) { 5 global $wp_rewrite, $ posts, $is_IIS;5 global $wp_rewrite, $is_IIS; 6 6 7 7 if ( is_feed() || is_trackback() || is_search() || is_comments_popup() || is_admin() || $is_IIS || ( isset($_POST) && count($_POST) ) || is_preview() ) … … 177 177 178 178 function redirect_guess_404_permalink() { 179 global $wp _query, $wpdb;179 global $wpdb; 180 180 if ( !get_query_var('name') ) 181 181 return false; trunk/wp-includes/capabilities.php
r5870 r6364 139 139 140 140 function WP_User($id, $name = '') { 141 global $wpdb;142 141 143 142 if ( empty($id) && empty($name) ) trunk/wp-includes/category-template.php
r6227 r6364 67 67 68 68 function get_the_category($id = false) { 69 global $post, $term_cache , $blog_id;69 global $post, $term_cache; 70 70 71 71 $id = (int) $id; … … 169 169 170 170 function in_category( $category ) { // Check if the current post is in the given category 171 global $post , $blog_id;171 global $post; 172 172 173 173 $categories = get_object_term_cache($post->ID, 'category'); trunk/wp-includes/category.php
r6125 r6364 2 2 3 3 function get_all_category_ids() { 4 global $wpdb;5 6 4 if ( ! $cat_ids = wp_cache_get('all_category_ids', 'category') ) { 7 5 $cat_ids = get_terms('category', 'fields=ids&get=all'); … … 40 38 41 39 function get_category_by_path($category_path, $full_match = true, $output = OBJECT) { 42 global $wpdb;43 40 $category_path = rawurlencode(urldecode($category_path)); 44 41 $category_path = str_replace('%2F', '/', $category_path); … … 87 84 // Get the ID of a category from its name 88 85 function get_cat_ID($cat_name='General') { 89 global $wpdb;90 91 86 $cat = get_term_by('name', $cat_name, 'category'); 92 87 if ($cat) … … 133 128 134 129 function &get_tags($args = '') { 135 global $wpdb, $category_links;136 137 130 $key = md5( serialize( $args ) ); 138 131 if ( $cache = wp_cache_get( 'get_tags', 'category' ) ) trunk/wp-includes/comment-template.php
r6173 r6364 39 39 40 40 function get_comment_author_link() { 41 global $comment;42 41 $url = get_comment_author_url(); 43 42 $author = get_comment_author(); … … 73 72 74 73 function get_comment_author_url_link( $linktext = '', $before = '', $after = '' ) { 75 global $comment;76 74 $url = get_comment_author_url(); 77 75 $display = ($linktext != '') ? $linktext : $url; … … 147 145 148 146 function get_comments_number( $post_id = 0 ) { 149 global $wpdb, $id;150 147 $post_id = (int) $post_id; 151 148 … … 238 235 239 236 function trackback_rdf($timezone = 0) { 240 global $id;241 237 if (stripos($_SERVER['HTTP_USER_AGENT'], 'W3C_Validator') === false) { 242 238 echo '<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" … … 310 306 311 307 function comments_popup_script($width=400, $height=400, $file='') { 312 global $wpcommentspopupfile, $wp trackbackpopupfile, $wppingbackpopupfile, $wpcommentsjavascript;308 global $wpcommentspopupfile, $wpcommentsjavascript; 313 309 314 310 if (empty ($file)) { … … 324 320 325 321 function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') { 326 global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post , $wpdb;322 global $id, $wpcommentspopupfile, $wpcommentsjavascript, $post; 327 323 328 324 if ( is_single() || is_page() ) trunk/wp-includes/comment.php
r6348 r6364 106 106 // Deprecate in favor of get_comment()? 107 107 function get_commentdata( $comment_ID, $no_cache = 0, $include_unapproved = false ) { // less flexible, but saves DB queries 108 global $postc, $id, $ commentdata, $wpdb;108 global $postc, $id, $wpdb; 109 109 if ( $no_cache ) { 110 110 $query = $wpdb->prepare("SELECT * FROM $wpdb->comments WHERE comment_ID = %d", $comment_ID); … … 130 130 131 131 function get_lastcommentmodified($timezone = 'server') { 132 global $cache_lastcommentmodified, $ pagenow, $wpdb;132 global $cache_lastcommentmodified, $wpdb; 133 133 $add_seconds_blog = get_option('gmt_offset') * 3600; 134 134 $add_seconds_server = date('Z'); … … 229 229 230 230 function wp_blacklist_check($author, $email, $url, $comment, $user_ip, $user_agent) { 231 global $wpdb;232 233 231 do_action('wp_blacklist_check', $author, $email, $url, $comment, $user_ip, $user_agent); 234 232 … … 294 292 295 293 function wp_get_comment_status($comment_id) { 296 global $wpdb;297 298 294 $comment = get_comment($comment_id); 299 295 if ( !$comment ) … … 687 683 688 684 function pingback($content, $post_ID) { 689 global $wp_version , $wpdb;685 global $wp_version; 690 686 include_once(ABSPATH . WPINC . '/class-IXR.php'); 691 687 trunk/wp-includes/feed.php
r6328 r6364 99 99 100 100 101 function comments_rss_link($link_text = 'Comments RSS', $ commentsrssfilename = 'nolongerused') {101 function comments_rss_link($link_text = 'Comments RSS', $deprecated = '') { 102 102 $url = get_post_comments_feed_link(); 103 103 echo "<a href='$url'>$link_text</a>"; … … 105 105 106 106 107 function comments_rss($ commentsrssfilename = 'nolongerused') {107 function comments_rss($deprecated = '') { 108 108 return get_post_comments_feed_link(); 109 109 } … … 111 111 112 112 function get_author_rss_link($echo = false, $author_id, $author_nicename) { 113 $auth _ID= (int) $author_id;113 $author_id = (int) $author_id; 114 114 $permalink_structure = get_option('permalink_structure'); 115 115 … … 169 169 170 170 171 function get_category_rss_link($echo = false, $cat_ID, $ category_nicename) {172 $link = get_category_feed_link($cat_ID, $feed ='rss2');171 function get_category_rss_link($echo = false, $cat_ID, $deprecated = '') { 172 $link = get_category_feed_link($cat_ID, 'rss2'); 173 173 174 174 if ( $echo ) … … 181 181 $categories = get_the_category(); 182 182 $tags = get_the_tags(); 183 $home = get_bloginfo_rss('home');184 183 $the_list = ''; 185 184 $cat_names = array(); … … 253 252 254 253 function rss_enclosure() { 255 global $ id, $post;254 global $post; 256 255 if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) 257 256 return; … … 268 267 269 268 function atom_enclosure() { 270 global $ id, $post;269 global $post; 271 270 if ( !empty($post->post_password) && ($_COOKIE['wp-postpass_'.COOKIEHASH] != $post->post_password) ) 272 271 return; trunk/wp-includes/formatting.php
r6331 r6364 364 364 } 365 365 366 function convert_chars($content, $ flag = 'obsolete') {366 function convert_chars($content, $deprecated = '') { 367 367 // Translation of invalid Unicode references range to valid range 368 368 $wp_htmltranswinuni = array( … … 561 561 562 562 function format_to_post($content) { 563 global $wpdb;564 563 $content = apply_filters('format_to_post', $content); 565 564 return $content; … … 784 783 $hours = round($diff / 3600); 785 784 if ($hours <= 1) { 786 $hour = 1;785 $hours = 1; 787 786 } 788 787 $since = sprintf(__ngettext('%s hour', '%s hours', $hours), $hours); … … 798 797 799 798 function wp_trim_excerpt($text) { // Fakes an excerpt if needed 800 global $post;801 799 if ( '' == $text ) { 802 800 $text = get_the_content(''); trunk/wp-includes/functions.php
r6340 r6364 109 109 110 110 111 function get_weekstartend( $mysqlstring, $start_of_week ) {111 function get_weekstartend( $mysqlstring, $start_of_week = '' ) { 112 112 $my = substr( $mysqlstring, 0, 4 ); 113 113 $mm = substr( $mysqlstring, 8, 2 ); … … 116 116 $weekday = date( 'w', $day ); 117 117 $i = 86400; 118 119 if ( $weekday < get_option( 'start_of_week' ) ) 120 $weekday = 7 - ( get_option( 'start_of_week' ) - $weekday ); 121 122 while ( $weekday > get_option( 'start_of_week' ) ) { 118 if( !is_numeric($a) ) 119 $start_of_week = get_option( 'start_of_week' ); 120 121 if ( $weekday < $start_of_week ) 122 $weekday = 7 - $start_of_week - $weekday; 123 124 while ( $weekday > $start_of_week ) { 123 125 $weekday = date( 'w', $day ); 124 if ( $weekday < get_option( 'start_of_week' ))125 $weekday = 7 - ( get_option( 'start_of_week' ) - $weekday );126 127 $day = $day -86400;126 if ( $weekday < $start_of_week ) 127 $weekday = 7 - $start_of_week - $weekday; 128 129 $day -= 86400; 128 130 $i = 0; 129 131 } … … 489 491 490 492 function do_enclose( $content, $post_ID ) { 491 global $wp _version, $wpdb;493 global $wpdb; 492 494 include_once( ABSPATH . WPINC . '/class-IXR.php' ); 493 495 … … 1029 1031 } 1030 1032 1031 function wp_upload_bits( $name, $ type, $bits ) {1033 function wp_upload_bits( $name, $deprecated, $bits ) { 1032 1034 if ( empty( $name ) ) 1033 1035 return array( 'error' => __( "Empty filename" ) ); … … 1067 1069 return array( 'error' => sprintf( __( 'Could not write file %s' ), $new_file ) ); 1068 1070 1069 $success =@fwrite( $ifp, $bits );1071 @fwrite( $ifp, $bits ); 1070 1072 fclose( $ifp ); 1071 1073 // Set correct file permissions … … 1212 1214 1213 1215 function wp_nonce_ays( $action ) { 1214 global $pagenow , $menu, $submenu, $parent_file, $submenu_file;1216 global $pagenow; 1215 1217 1216 1218 $adminurl = get_option( 'siteurl' ) . '/wp-admin'; … … 1500 1502 curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); 1501 1503 1502 $data = curl_exec($ch);1504 curl_exec($ch); 1503 1505 1504 1506 $status = curl_getinfo($ch, CURLINFO_HTTP_CODE); trunk/wp-includes/general-template.php
r6343 r6364 165 165 $cat = get_query_var('cat'); 166 166 $tag = get_query_var('tag_id'); 167 $p = get_query_var('p');168 $name = get_query_var('name');169 167 $category_name = get_query_var('category_name'); 170 168 $author = get_query_var('author'); … … 386 384 $archive_week_end_date_format = get_option('date_format'); 387 385 } 388 389 $add_hours = intval(get_option('gmt_offset'));390 $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours));391 386 392 387 //filters … … 525 520 526 521 function get_calendar($initial = true) { 527 global $wpdb, $m, $monthnum, $year, $ timedifference, $wp_locale, $posts;522 global $wpdb, $m, $monthnum, $year, $wp_locale, $posts; 528 523 529 524 $key = md5( $m . $monthnum . $year ); … … 548 543 // week_begins = 0 stands for Sunday 549 544 $week_begins = intval(get_option('start_of_week')); 550 $add_hours = intval(get_option('gmt_offset'));551 $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours));552 545 553 546 // Let's figure out when we are … … 561 554 $thismonth = $wpdb->get_var("SELECT DATE_FORMAT((DATE_ADD('${thisyear}0101', INTERVAL $d DAY) ), '%m')"); 562 555 } elseif ( !empty($m) ) { 563 $calendar = substr($m, 0, 6);564 556 $thisyear = ''.intval(substr($m, 0, 4)); 565 557 if ( strlen($m) < 6 ) … … 756 748 757 749 function the_date($d='', $before='', $after='', $echo = true) { 758 global $ id, $post, $day, $previousday;750 global $post, $day, $previousday; 759 751 $the_date = ''; 760 752 if ( $day != $previousday ) { … … 843 835 844 836 function the_weekday() { 845 global $wp_locale, $ id, $post;837 global $wp_locale, $post; 846 838 $the_weekday = $wp_locale->get_weekday(mysql2date('w', $post->post_date)); 847 839 $the_weekday = apply_filters('the_weekday', $the_weekday); … … 851 843 852 844 function the_weekday_date($before='',$after='') { 853 global $wp_locale, $ id, $post, $day, $previousweekday;845 global $wp_locale, $post, $day, $previousweekday; 854 846 $the_weekday_date = ''; 855 847 if ( $day != $previousweekday ) { trunk/wp-includes/l10n.php
r5258 r6364 76 76 77 77 function load_default_textdomain() { 78 global $l10n;79 80 78 $locale = get_locale(); 81 79 if ( empty($locale) ) trunk/wp-includes/link-template.php
r6359 r6364 233 233 function get_feed_link($feed='rss2') { 234 234 global $wp_rewrite; 235 $do_perma = 0;236 $feed_url = get_option('siteurl');237 $comment_feed_url = $feed_url;238 235 239 236 $permalink = $wp_rewrite->get_feed_permastruct(); … … 495 492 496 493 function get_next_posts_page_link($max_page = 0) { 497 global $paged , $pagenow;494 global $paged; 498 495 499 496 if ( !is_single() ) { … … 511 508 512 509 function next_posts_link($label='Next Page »', $max_page=0) { 513 global $paged, $wp db, $wp_query;510 global $paged, $wp_query; 514 511 if ( !$max_page ) { 515 512 $max_page = $wp_query->max_num_pages; … … 526 523 527 524 function get_previous_posts_page_link() { 528 global $paged , $pagenow;525 global $paged; 529 526 530 527 if ( !is_single() ) { trunk/wp-includes/pluggable.php
r6350 r6364 529 529 if ( ! function_exists('wp_notify_postauthor') ) : 530 530 function wp_notify_postauthor($comment_id, $comment_type='') { 531 global $wpdb;532 533 531 $comment = get_comment($comment_id); 534 532 $post = get_post($comment->comment_post_ID); trunk/wp-includes/post-template.php
r6228 r6364 82 82 83 83 function get_the_content($more_link_text = '(more...)', $stripteaser = 0, $more_file = '') { 84 global $id, $post, $more, $single, $withcomments, $page, $pages, $multipage, $numpages; 85 global $preview; 86 global $pagenow; 84 global $id, $post, $more, $page, $pages, $multipage, $preview, $pagenow; 85 87 86 $output = ''; 88 87 … … 138 137 139 138 140 function get_the_excerpt($deprecated = true) {141 global $ id, $post;139 function get_the_excerpt($deprecated = '') { 140 global $post; 142 141 $output = ''; 143 142 $output = $post->post_excerpt; … … 168 167 extract( $r, EXTR_SKIP ); 169 168 170 global $post, $ id, $page, $numpages, $multipage, $more, $pagenow;169 global $post, $page, $numpages, $multipage, $more, $pagenow; 171 170 if ( $more_file != '' ) 172 171 $file = $more_file; … … 250 249 // this will probably change at some point... 251 250 function the_meta() { 252 global $id;253 254 251 if ( $keys = get_post_custom_keys() ) { 255 252 echo "<ul class='post-meta'>\n"; … … 386 383 if ( !$post = & get_post($id) ) 387 384 return false; 388 389 $imagedata = wp_get_attachment_metadata( $post->ID );390 385 391 386 $file = get_attached_file( $post->ID ); 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') ) trunk/wp-includes/query.php
r6341 r6364 729 729 730 730 function &get_posts() { 731 global $wpdb, $ pagenow, $user_ID;731 global $wpdb, $user_ID; 732 732 733 733 do_action_ref_array('pre_get_posts', array(&$this)); … … 742 742 $whichcat = ''; 743 743 $whichauthor = ''; 744 $whichpage = '';745 $result = '';746 744 $where = ''; 747 745 $limits = ''; … … 789 787 $q['page'] = abs($q['page']); 790 788 } 791 792 $add_hours = intval(get_option('gmt_offset'));793 $add_minutes = intval(60 * (get_option('gmt_offset') - $add_hours));794 $wp_posts_post_date_field = "post_date"; // "DATE_ADD(post_date, INTERVAL '$add_hours:$add_minutes' HOUR_MINUTE)";795 789 796 790 // If a month is specified in the querystring, load that month … … 1496 1490 // Setup global post data. 1497 1491 function setup_postdata($post) { 1498 global $id, $postdata, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages, $wp_query; 1499 global $pagenow; 1492 global $id, $authordata, $day, $currentmonth, $page, $pages, $multipage, $more, $numpages; 1500 1493 1501 1494 $id = (int) $post->ID; trunk/wp-includes/rewrite.php
r6351 r6364 312 312 313 313 function page_rewrite_rules() { 314 global $wpdb;315 316 314 $rewrite_rules = array(); 317 315 $page_structure = $this->get_page_permastruct(); trunk/wp-includes/taxonomy.php
r6355 r6364 774 774 */ 775 775 function sanitize_term_field($field, $value, $term_id, $taxonomy, $context) { 776 if ( 'parent' == $field || 'term_id' == $field || 'count' == $field 777 || 'term_group' == $field ) 776 if ( 'parent' == $field || 'term_id' == $field || 'count' == $field || 'term_group' == $field ) 778 777 $value = (int) $value; 779 778 … … 1210 1209 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s AND term_id != %d", $slug, $args['term_id'] ); 1211 1210 else 1212 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s $where", $slug );1211 $query = $wpdb->prepare( "SELECT slug FROM $wpdb->terms WHERE slug = %s", $slug ); 1213 1212 1214 1213 if ( $wpdb->get_var( $query ) ) { … … 1472 1471 */ 1473 1472 function update_object_term_cache($object_ids, $object_type) { 1474 global $wpdb;1475 1476 1473 if ( empty($object_ids) ) 1477 1474 return; trunk/wp-includes/theme.php
r6334 r6364 437 437 438 438 function load_template($_template_file) { 439 global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, 440 $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; 439 global $posts, $post, $wp_did_header, $wp_did_template_redirect, $wp_query, $wp_rewrite, $wpdb, $wp_version, $wp, $id, $comment, $user_ID; 441 440 442 441 if ( is_array($wp_query->query_vars) ) trunk/wp-includes/user.php
r6350 r6364 76 76 $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'"); 77 77 78 $user = get_userdata($user_id);79 78 wp_cache_delete($user_id, 'users'); 80 79 … … 139 138 } 140 139 141 $user = get_userdata($user_id);142 140 wp_cache_delete($user_id, 'users'); 143 141 trunk/wp-includes/widgets.php
r6323 r6364 228 228 $sidebars_widgets = wp_get_sidebars_widgets(false); 229 229 230 if ( is_array($sidebars_widgets) ) foreach ( $sidebars_widgets as $ sidebar => $widgets )230 if ( is_array($sidebars_widgets) ) foreach ( $sidebars_widgets as $widgets ) 231 231 if ( is_array($widgets) ) foreach ( $widgets as $widget ) 232 232 if ( $wp_registered_widgets[$widget]['callback'] == $callback ) … … 573 573 574 574 function wp_widget_text_page() { 575 $options = $newoptions =get_option('widget_text');575 $options = get_option('widget_text'); 576 576 ?> 577 577 <div class="wrap"> … … 1006 1006 $newoptions[$number]['error'] = true; 1007 1007 $newoptions[$number]['url'] = wp_specialchars(__('Error: could not find an RSS or ATOM feed at that URL.'), 1); 1008 $error = sprintf(__('Error in RSS %1$d: %2$s'), $number, $newoptions[$number]['error']);1009 1008 } 1010 1009 } … … 1024 1023 <input style="width: 400px;" id="rss-title-<?php echo "$number"; ?>" name="rss-title-<?php echo "$number"; ?>" type="text" value="<?php echo $title; ?>" /> 1025 1024 <p style="text-align:center; line-height: 30px;"><?php _e('How many items would you like to display?'); ?> <select id="rss-items-<?php echo $number; ?>" name="rss-items-<?php echo $number; ?>"><?php for ( $i = 1; $i <= 10; ++$i ) echo "<option value='$i' ".($items==$i ? "selected='selected'" : '').">$i</option>"; ?></select></p> 1026 <input type="hidden" id="rss-submit-<?php echo "$number"; ?>" name="rss-submit-<?php echo "$number"; ?>" value="1" />1025 <input type="hidden" id="rss-submit-<?php echo "$number"; ?>" name="rss-submit-<?php echo $number; ?>" value="1" /> 1027 1026 <?php 1028 1027 } … … 1044 1043 1045 1044 function wp_widget_rss_page() { 1046 $options = $newoptions =get_option('widget_rss');1045 $options = get_option('widget_rss'); 1047 1046 ?> 1048 1047 <div class="wrap"> trunk/wp-login.php
r6350 r6364 28 28 // Rather than duplicating this HTML all over the place, we'll stick it in function 29 29 function login_header($title = 'Login', $message = '') { 30 global $errors, $error , $wp_locale;30 global $errors, $error; 31 31 32 32 ?> trunk/xmlrpc.php
r6358 r6364 460 460 */ 461 461 function wp_getAuthors($args) { 462 global $wpdb;463 462 464 463 $this->escape($args); … … 534 533 */ 535 534 function wp_suggestCategories($args) { 536 global $wpdb;537 538 535 $this->escape($ar
