Changeset 5089
- Timestamp:
- 03/23/2007 02:05:29 AM (18 years ago)
- Location:
- trunk
- Files:
-
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/app.php
r5087 r5089 431 431 log_app('Inserting Post. Data:', print_r($post_data,true)); 432 432 433 $postID = (int)wp_insert_post($post_data);433 $postID = wp_insert_post($post_data); 434 434 435 435 if (!$postID) { … … 583 583 584 584 // Save the data 585 $postID = (int)wp_insert_attachment($attachment, $file, $post);585 $postID = wp_insert_attachment($attachment, $file, $post); 586 586 587 587 if (!$postID) { -
trunk/wp-admin/admin-ajax.php
r5087 r5089 116 116 if ( !$category_nicename = sanitize_title($cat_name) ) 117 117 die('0'); 118 if ( !$cat_id = (int)category_exists( $cat_name ) )119 $cat_id = (int)wp_create_category( $cat_name );118 if ( !$cat_id = category_exists( $cat_name ) ) 119 $cat_id = wp_create_category( $cat_name ); 120 120 $cat_name = wp_specialchars(stripslashes($cat_name)); 121 121 $x->add( array( … … 157 157 if ( $id < 0 ) { 158 158 $now = current_time('timestamp', 1); 159 if ( $pid = (int)wp_insert_post( array(159 if ( $pid = wp_insert_post( array( 160 160 'post_title' => sprintf('Draft created on %s at %s', date(get_option('date_format'), $now), date(get_option('time_format'), $now)) 161 161 ) ) ) 162 $mid = (int)add_meta( $pid );162 $mid = add_meta( $pid ); 163 163 else 164 164 die('0'); 165 } else if ( !$mid = (int)add_meta( $id ) ) {165 } else if ( !$mid = add_meta( $id ) ) { 166 166 die('0'); 167 167 } … … 205 205 die('-1'); 206 206 require_once(ABSPATH . WPINC . '/registration.php'); 207 if ( !$user_id = (int)add_user() )207 if ( !$user_id = add_user() ) 208 208 die('0'); 209 209 elseif ( is_wp_error( $user_id ) ) { … … 231 231 if($_POST['post_ID'] < 0) { 232 232 $_POST['temp_ID'] = $_POST['post_ID']; 233 $id = (int)wp_write_post();234 if( is_wp_error($id))233 $id = wp_write_post(); 234 if( is_wp_error($id) ) 235 235 die($id->get_error_message()); 236 236 else -
trunk/wp-admin/admin-functions.php
r5087 r5089 563 563 564 564 if ( $update ) { 565 $user_id = (int)wp_update_user( get_object_vars( $user ));566 } else { 567 $user_id = (int)wp_insert_user( get_object_vars( $user ));565 $user_id = wp_update_user( get_object_vars( $user )); 566 } else { 567 $user_id = wp_insert_user( get_object_vars( $user )); 568 568 wp_new_user_notification( $user_id ); 569 569 } … … 1970 1970 1971 1971 // Save the data 1972 $id = (int)wp_insert_attachment( $object, $file );1972 $id = wp_insert_attachment( $object, $file ); 1973 1973 1974 1974 return array( 'file' => $file, 'id' => $id ); -
trunk/wp-admin/custom-header.php
r5087 r5089 216 216 217 217 // Save the data 218 $id = (int)wp_insert_attachment($object, $file);218 $id = wp_insert_attachment($object, $file); 219 219 220 220 $upload = array('file' => $file, 'id' => $id); -
trunk/wp-admin/import/wordpress.php
r5087 r5089 202 202 $category_parent = '0'; 203 203 else 204 $category_parent = (int)category_exists($parent);204 $category_parent = category_exists($parent); 205 205 206 206 $catarr = compact('category_nicename', 'category_parent', 'posts_private', 'links_private', 'posts_private', 'cat_name'); -
trunk/wp-comments-post.php
r5087 r5089 55 55 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_email', 'comment_author_url', 'comment_content', 'comment_type', 'user_ID'); 56 56 57 $comment_id = (int)wp_new_comment( $commentdata );57 $comment_id = wp_new_comment( $commentdata ); 58 58 59 59 $comment = get_comment($comment_id); -
trunk/wp-includes/comment.php
r5087 r5089 393 393 $commentdata['comment_approved'] = wp_allow_comment($commentdata); 394 394 395 $comment_ID = (int)wp_insert_comment($commentdata);395 $comment_ID = wp_insert_comment($commentdata); 396 396 397 397 do_action('comment_post', $comment_ID, $commentdata['comment_approved']); -
trunk/wp-login.php
r5087 r5089 243 243 $user_pass = substr( md5( uniqid( microtime() ) ), 0, 7); 244 244 245 $user_id = (int)wp_create_user( $user_login, $user_pass, $user_email );245 $user_id = wp_create_user( $user_login, $user_pass, $user_email ); 246 246 if ( !$user_id ) 247 247 $errors['registerfail'] = sprintf(__('<strong>ERROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !'), get_option('admin_email')); -
trunk/wp-mail.php
r5087 r5089 137 137 $post_data = add_magic_quotes($post_data); 138 138 139 $post_ID = (int)wp_insert_post($post_data);139 $post_ID = wp_insert_post($post_data); 140 140 141 141 if (!$post_ID) { -
trunk/xmlrpc.php
r5087 r5089 513 513 ); 514 514 515 $cat_id = (int)wp_insert_category($new_category);515 $cat_id = wp_insert_category($new_category); 516 516 if(!$cat_id) { 517 517 return(new IXR_Error(500, "Sorry, the new category failed.")); … … 803 803 $post_data = compact('blog_ID', 'post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status'); 804 804 805 $post_ID = (int)wp_insert_post($post_data);805 $post_ID = wp_insert_post($post_data); 806 806 807 807 if (!$post_ID) { … … 1031 1031 $postdata = compact('post_author', 'post_date', 'post_date_gmt', 'post_content', 'post_title', 'post_category', 'post_status', 'post_excerpt', 'comment_status', 'ping_status', 'to_ping', 'post_type', 'post_name', 'post_password', 'post_parent', 'menu_order'); 1032 1032 1033 $post_ID = (int)wp_insert_post($postdata);1033 $post_ID = wp_insert_post($postdata); 1034 1034 1035 1035 if (!$post_ID) { … … 1448 1448 1449 1449 // Save the data 1450 $id = (int)wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id );1450 $id = wp_insert_attachment( $attachment, $upload[ 'file' ], $post_id ); 1451 1451 wp_update_attachment_metadata( $id, wp_generate_attachment_metadata( $id, $upload['file'] ) ); 1452 1452 … … 1838 1838 $commentdata = compact('comment_post_ID', 'comment_author', 'comment_author_url', 'comment_content', 'comment_type'); 1839 1839 1840 $comment_ID = (int)wp_new_comment($commentdata);1840 $comment_ID = wp_new_comment($commentdata); 1841 1841 do_action('pingback_post', $comment_ID); 1842 1842 … … 1856 1856 $url = $args; 1857 1857 1858 $post_ID = (int)url_to_postid($url);1858 $post_ID = url_to_postid($url); 1859 1859 if (!$post_ID) { 1860 1860 // We aren't sure that the resource is available and/or pingback enabled
Note: See TracChangeset
for help on using the changeset viewer.