Changeset 32188 for branches/3.7/src/wp-admin/includes/post.php
- Timestamp:
- 04/20/2015 11:51:13 AM (11 years ago)
- File:
-
- 1 edited
-
branches/3.7/src/wp-admin/includes/post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/3.7/src/wp-admin/includes/post.php
r28115 r32188 167 167 */ 168 168 function edit_post( $post_data = null ) { 169 global $wpdb; 169 170 170 171 if ( empty($post_data) ) … … 296 297 update_post_meta( $post_ID, '_edit_last', get_current_user_id() ); 297 298 298 wp_update_post( $post_data ); 299 $success = wp_update_post( $post_data ); 300 // If the save failed, see if we can sanity check the main fields and try again 301 if ( ! $success && is_callable( array( $wpdb, 'strip_invalid_text_for_column' ) ) ) { 302 $fields = array( 'post_title', 'post_content', 'post_excerpt' ); 303 304 foreach( $fields as $field ) { 305 if ( isset( $post_data[ $field ] ) ) { 306 $post_data[ $field ] = $wpdb->strip_invalid_text_for_column( $wpdb->posts, $field, $post_data[ $field ] ); 307 } 308 } 309 310 wp_update_post( $post_data ); 311 } 299 312 300 313 // Now that we have an ID we can fix any attachment anchor hrefs
Note: See TracChangeset
for help on using the changeset viewer.