Changeset 3517 for trunk/wp-admin/admin-db.php
- Timestamp:
- 02/12/2006 07:53:23 AM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-db.php
r3350 r3517 15 15 16 16 $editable = get_editable_user_ids( $user_id ); 17 17 18 18 if( !$editable ) { 19 19 $other_drafts = ''; … … 43 43 function get_editable_user_ids( $user_id, $exclude_zeros = true ) { 44 44 global $wpdb; 45 45 46 46 $user = new WP_User( $user_id ); 47 47 48 48 if ( ! $user->has_cap('edit_others_posts') ) { 49 49 if ( $user->has_cap('edit_posts') || $exclude_zeros == false ) … … 58 58 if ( $exclude_zeros ) 59 59 $query .= " AND meta_value != '0'"; 60 60 61 61 return $wpdb->get_col( $query ); 62 62 } … … 112 112 $wpdb->query ("UPDATE $wpdb->categories SET cat_name = '$cat_name', category_nicename = '$category_nicename', category_description = '$category_description', category_parent = '$category_parent' WHERE cat_ID = '$cat_ID'"); 113 113 } 114 114 115 115 if ( $category_nicename == '' ) { 116 116 $category_nicename = sanitize_title($cat_name, $cat_ID ); … … 243 243 function get_link($link_id, $output = OBJECT) { 244 244 global $wpdb; 245 245 246 246 $link = $wpdb->get_row("SELECT * FROM $wpdb->links WHERE link_id = '$link_id'"); 247 247 … … 259 259 function wp_insert_link($linkdata) { 260 260 global $wpdb, $current_user; 261 261 262 262 extract($linkdata); 263 263 … … 267 267 268 268 if ( empty($link_rating) ) 269 $link_rating = 0; 269 $link_rating = 0; 270 270 271 271 if ( empty($link_target) ) 272 $link_target = ''; 272 $link_target = ''; 273 273 274 274 if ( empty($link_visible) ) 275 275 $link_visible = 'Y'; 276 276 277 277 if ( empty($link_owner) ) 278 278 $link_owner = $current_user->id; … … 293 293 $link_id = $wpdb->insert_id; 294 294 } 295 295 296 296 if ( $update ) 297 297 do_action('edit_link', $link_id); … … 306 306 307 307 $link_id = (int) $linkdata['link_id']; 308 308 309 309 $link = get_link($link_id, ARRAY_A); 310 310 311 311 // Escape data pulled from DB. 312 312 $link = add_magic_quotes($link); 313 313 314 314 // Merge old and new fields with new fields overwriting old ones. 315 315 $linkdata = array_merge($link, $linkdata); … … 322 322 323 323 do_action('delete_link', $link_id); 324 return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'"); 324 return $wpdb->query("DELETE FROM $wpdb->links WHERE link_id = '$link_id'"); 325 325 } 326 326
Note: See TracChangeset
for help on using the changeset viewer.