Changeset 10910
- Timestamp:
- 04/10/2009 09:56:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/wp-db.php
r10907 r10910 254 254 var $tables = array('users', 'usermeta', 'posts', 'categories', 'post2cat', 'comments', 'links', 'link2cat', 'options', 255 255 'postmeta', 'terms', 'term_taxonomy', 'term_relationships'); 256 257 /** 258 * Format specifiers for DB columns. Columns not listed here default to %s. Initialized in wp-settings.php. 259 * 260 * Keys are colmn names, values are format types: 'ID' => '%d' 261 * 262 * @since 2.8.0 263 * @see wpdb:prepare() 264 * @see wpdb:insert() 265 * @see wpdb:update() 266 * @access public 267 * @war array 268 */ 269 var $field_type = array(); 256 270 257 271 /** … … 704 718 */ 705 719 function insert($table, $data, $format = null) { 706 global $db_field_types;707 708 720 $formats = $format = (array) $format; 709 721 $fields = array_keys($data); … … 712 724 if ( !empty($format) ) 713 725 $form = ( $form = array_shift($formats) ) ? $form : $format[0]; 714 elseif ( isset($ db_field_types[$field]) )715 $form = $ db_field_types[$field];726 elseif ( isset($this->field_types[$field]) ) 727 $form = $this->field_types[$field]; 716 728 else 717 729 $form = '%s'; … … 735 747 */ 736 748 function update($table, $data, $where, $format = null, $where_format = null) { 737 global $db_field_types;738 739 749 if ( !is_array( $where ) ) 740 750 return false; … … 745 755 if ( !empty($format) ) 746 756 $form = ( $form = array_shift($formats) ) ? $form : $format[0]; 747 elseif ( isset($ db_field_types[$field]) )748 $form = $ db_field_types[$field];757 elseif ( isset($this->field_types[$field]) ) 758 $form = $this->field_types[$field]; 749 759 else 750 760 $form = '%s'; … … 756 766 if ( !empty($where_format) ) 757 767 $form = ( $form = array_shift($where_formats) ) ? $form : $where_format[0]; 758 elseif ( isset($ db_field_types[$field]) )759 $form = $ db_field_types[$field];768 elseif ( isset($this->field_types[$field]) ) 769 $form = $this->field_types[$field]; 760 770 else 761 771 $form = '%s'; -
trunk/wp-settings.php
r10892 r10910 248 248 require (ABSPATH . WPINC . '/classes.php'); 249 249 250 require_wp_db(); 251 252 if ( !empty($wpdb->error) ) 253 dead_db(); 254 250 255 /** 251 256 * Format specifiers for DB columns. Columns not listed here default to %s. 252 257 * @since 2.8.0 253 */ 254 $db_field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', 258 * @see wpdb:$field_types 259 * @see wpdb:prepare() 260 * @see wpdb:insert() 261 * @see wpdb:update() 262 */ 263 $wpdb->field_types = array( 'post_author' => '%d', 'post_parent' => '%d', 'menu_order' => '%d', 'term_id' => '%d', 'term_group' => '%d', 'term_taxonomy_id' => '%d', 255 264 'parent' => '%d', 'count' => '%d','object_id' => '%d', 'term_order' => '%d', 'ID' => '%d', 'commment_ID' => '%d', 'comment_post_ID' => '%d', 'comment_parent' => '%d', 256 265 'user_id' => '%d', 'link_id' => '%d', 'link_owner' => '%d', 'link_rating' => '%d', 'option_id' => '%d', 'blog_id' => '%d', 'meta_id' => '%d', 'post_id' => '%d', 257 266 'user_status' => '%d', 'umeta_id' => '%d', 'comment_karma' => '%d', 'comment_count' => '%d'); 258 259 require_wp_db();260 261 if ( !empty($wpdb->error) )262 dead_db();263 267 264 268 $prefix = $wpdb->set_prefix($table_prefix);
Note: See TracChangeset
for help on using the changeset viewer.