Changeset 2690 for branches/1.5/wp-includes/functions-post.php
- Timestamp:
- 07/03/2005 01:03:13 AM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/1.5/wp-includes/functions-post.php
r2681 r2690 104 104 105 105 // First get all of the original fields 106 extract(wp_get_single_post($postarr['ID'], ARRAY_A)); 107 108 // Now overwrite any changed values being passed in 106 $post = wp_get_single_post($postarr['ID'], ARRAY_A); 107 108 // Escape data pulled from DB. 109 $post = add_magic_quotes($post); 110 extract($post); 111 112 // Now overwrite any changed values being passed in. These are 113 // already escaped. 109 114 extract($postarr); 110 115 111 // Make sure we set a valid category116 // If no categories were passed along, use the current cats. 112 117 if ( 0 == count($post_category) || !is_array($post_category) ) 113 $post_category = array(get_option('default_category'));118 $post_category = $post['post_category']; 114 119 115 120 $post_modified = current_time('mysql'); … … 150 155 $result = $wpdb->get_col($sql); 151 156 157 if ( !$result ) 158 $result = array(); 159 152 160 return array_unique($result); 153 161 } … … 156 164 global $wpdb; 157 165 // If $post_categories isn't already an array, make it one: 158 if (!is_array($post_categories)) { 159 if (!$post_categories) { 160 $post_categories = get_option('default_category'); 161 } 162 $post_categories = array($post_categories); 163 } 166 if (!is_array($post_categories) || 0 == count($post_categories)) 167 $post_categories = array(get_option('default_category')); 164 168 165 169 $post_categories = array_unique($post_categories);
Note: See TracChangeset
for help on using the changeset viewer.