Changeset 5087 for trunk/wp-admin/admin-functions.php
- Timestamp:
- 03/23/2007 12:59:21 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-functions.php
r5072 r5087 115 115 if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) 116 116 $draft_ids = array(); 117 if ( $draft_temp_id = array_search( $post_ID, $draft_ids ) )117 if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 118 118 relocate_children( $draft_temp_id, $post_ID ); 119 119 if ( $temp_id && $temp_id != $draft_temp_id ) … … 158 158 continue; 159 159 160 $id = $id_matches[3];160 $id = (int) $id_matches[3]; 161 161 162 162 // While we have the attachment ID, let's adopt any orphans. … … 291 291 if ( !$draft_ids = get_user_option( 'autosave_draft_ids' ) ) 292 292 $draft_ids = array(); 293 if ( $draft_temp_id = array_search( $post_ID, $draft_ids ) )293 if ( $draft_temp_id = (int) array_search( $post_ID, $draft_ids ) ) 294 294 relocate_children( $draft_temp_id, $post_ID ); 295 295 … … 448 448 if ( func_num_args() ) { // The hackiest hack that ever did hack 449 449 global $current_user, $wp_roles; 450 $user_id = func_get_arg( 0 );450 $user_id = (int) func_get_arg( 0 ); 451 451 452 452 if ( isset( $_POST['role'] ) ) { … … 466 466 if ( $user_id != 0 ) { 467 467 $update = true; 468 $user->ID = $user_id;468 $user->ID = (int) $user_id; 469 469 $userdata = get_userdata( $user_id ); 470 470 $user->user_login = $wpdb->escape( $userdata->user_login ); … … 563 563 564 564 if ( $update ) { 565 $user_id = wp_update_user( get_object_vars( $user ));566 } else { 567 $user_id = wp_insert_user( get_object_vars( $user ));565 $user_id = (int) wp_update_user( get_object_vars( $user )); 566 } else { 567 $user_id = (int) wp_insert_user( get_object_vars( $user )); 568 568 wp_new_user_notification( $user_id ); 569 569 } … … 794 794 if ( current_user_can( 'manage_categories' ) ) { 795 795 $edit = "<a href='categories.php?action=edit&cat_ID=$category->cat_ID' class='edit'>".__( 'Edit' )."</a></td>"; 796 $default_cat_id = get_option( 'default_category' );797 $default_link_cat_id = get_option( 'default_link_category' );796 $default_cat_id = (int) get_option( 'default_category' ); 797 $default_link_cat_id = (int) get_option( 'default_link_category' ); 798 798 799 799 if ( ($category->cat_ID != $default_cat_id ) && ($category->cat_ID != $default_link_cat_id ) ) … … 834 834 $post->post_title = wp_specialchars( $post->post_title ); 835 835 $pad = str_repeat( '— ', $level ); 836 $id = $post->ID;836 $id = (int) $post->ID; 837 837 $class = ('alternate' == $class ) ? '' : 'alternate'; 838 838 ?> … … 1970 1970 1971 1971 // Save the data 1972 $id = wp_insert_attachment( $object, $file );1972 $id = (int) wp_insert_attachment( $object, $file ); 1973 1973 1974 1974 return array( 'file' => $file, 'id' => $id );
Note: See TracChangeset
for help on using the changeset viewer.