Changeset 3517 for trunk/wp-includes/functions.php
- Timestamp:
- 02/12/2006 07:53:23 AM (20 years ago)
- File:
-
- 1 edited
-
trunk/wp-includes/functions.php (modified) (14 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-includes/functions.php
r3514 r3517 23 23 } 24 24 $i = mktime(substr($m,11,2),substr($m,14,2),substr($m,17,2),substr($m,5,2),substr($m,8,2),substr($m,0,4)); 25 25 26 26 if ( -1 == $i || false == $i ) 27 27 $i = 0; … … 305 305 function get_user_option( $option, $user = 0 ) { 306 306 global $wpdb, $current_user; 307 307 308 308 if ( empty($user) ) 309 309 $user = $current_user; … … 658 658 $path = '/' . $curpage->post_name . $path; 659 659 } 660 660 661 661 $page->fullpath = $path; 662 662 … … 727 727 } 728 728 } 729 729 730 730 if (!isset($_page->fullpath)) { 731 731 $_page = set_page_path($_page); … … 752 752 $path = '/' . $curcat->category_nicename . $path; 753 753 } 754 754 755 755 $cat->fullpath = $path; 756 756 … … 778 778 if ( !isset($_category->fullpath) ) { 779 779 $_category = set_category_path($_category); 780 wp_cache_replace($_category->cat_ID, $_category, 'category'); 780 wp_cache_replace($_category->cat_ID, $_category, 'category'); 781 781 } 782 782 … … 831 831 function get_all_category_ids() { 832 832 global $wpdb; 833 833 834 834 if ( ! $cat_ids = wp_cache_get('all_category_ids', 'category') ) { 835 835 $cat_ids = $wpdb->get_col("SELECT cat_ID FROM $wpdb->categories"); 836 836 wp_cache_add('all_category_ids', $cat_ids, 'category'); 837 837 } 838 838 839 839 return $cat_ids; 840 840 } … … 842 842 function get_all_page_ids() { 843 843 global $wpdb; 844 844 845 845 if ( ! $page_ids = wp_cache_get('all_page_ids', 'pages') ) { 846 846 $page_ids = $wpdb->get_col("SELECT ID FROM $wpdb->posts WHERE post_type = 'page'"); 847 847 wp_cache_add('all_page_ids', $page_ids, 'pages'); 848 848 } 849 849 850 850 return $page_ids; 851 851 } … … 1417 1417 if ( empty($dogs) ) 1418 1418 return; 1419 1419 1420 1420 foreach ($dogs as $catt) 1421 1421 $category_cache[$catt->post_id][$catt->category_id] = &get_category($catt->category_id); … … 1524 1524 function is_preview() { 1525 1525 global $wp_query; 1526 1526 1527 1527 return $wp_query->is_preview; 1528 1528 } … … 2176 2176 function wp($query_vars = '') { 2177 2177 global $wp; 2178 2178 2179 2179 $wp->main($query_vars); 2180 2180 } … … 2246 2246 $meta_value = serialize($meta_value); 2247 2247 $meta_value = trim( $meta_value ); 2248 2248 2249 2249 if (empty($meta_value)) { 2250 2250 delete_usermeta($user_id, $meta_key); … … 2259 2259 $wpdb->query("UPDATE $wpdb->usermeta SET meta_value = '$meta_value' WHERE user_id = '$user_id' AND meta_key = '$meta_key'"); 2260 2260 } else { 2261 return false; 2262 } 2263 2261 return false; 2262 } 2263 2264 2264 $user = get_userdata($user_id); 2265 2265 wp_cache_delete($user_id, 'users'); 2266 2266 wp_cache_delete($user->user_login, 'userlogins'); 2267 2267 2268 2268 return true; 2269 2269 } … … 2283 2283 else 2284 2284 $wpdb->query("DELETE FROM $wpdb->usermeta WHERE user_id = '$user_id' AND meta_key = '$meta_key'"); 2285 2285 2286 2286 $user = get_userdata($user_id); 2287 2287 wp_cache_delete($user_id, 'users'); 2288 2288 wp_cache_delete($user->user_login, 'userlogins'); 2289 2289 2290 2290 return true; 2291 2291 }
Note: See TracChangeset
for help on using the changeset viewer.