Changeset 8318 for trunk/wp-admin/press-this.php
- Timestamp:
- 07/11/2008 11:38:32 PM (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r8316 r8318 21 21 $quick['post_content'] = ''; 22 22 23 $posted = str_replace('<br />', "\n", str_replace('<p>', '', $_REQUEST['content']));24 $posted = str_replace('</p>', "\n\n", $posted);25 26 23 // insert the post with nothing in it, to get an ID 27 24 $post_ID = wp_insert_post($quick, true); … … 31 28 case 'text': 32 29 case 'quote': 33 $content .= $ posted;30 $content .= $_REQUEST['content']; 34 31 break; 35 32 36 33 case 'photo': 37 $content = $ posted;34 $content = $_REQUEST['content']; 38 35 39 36 foreach( (array) $_REQUEST['photo_src'] as $key => $image) { … … 42 39 43 40 // see if files exist in content - we don't want to upload non-used selected files. 44 if( strpos($ posted, $quoted) !== false ) {41 if( strpos($_REQUEST['content'], $quoted) !== false ) { 45 42 $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); 46 43 // Replace the POSTED content <img> with correct uploaded ones. … … 54 51 if($_REQUEST['embed_code']) 55 52 $content .= $_REQUEST['embed_code']."\n\n"; 56 $content .= $ posted;53 $content .= $_REQUEST['content']; 57 54 break; 58 55 } 59 56 // set the post_content 60 $quick['post_content'] = preg_replace("/\n\n+/", "\n\n", $content);57 $quick['post_content'] = $content; 61 58 62 59 // error handling for $post … … 306 303 wp_enqueue_style( 'colors' ); 307 304 wp_enqueue_script('post'); 305 wp_enqueue_script('editor_functions'); 308 306 309 307 do_action('admin_print_styles'); … … 349 347 plugins : "safari,inlinepopups", 350 348 entities : "38,amp,60,lt,62,gt", 351 force_p_newlines : true 349 force_p_newlines : true, 350 save_callback : 'switchEditors.saveCallback' 352 351 }); 353 352 <?php } ?>
Note: See TracChangeset
for help on using the changeset viewer.