Changeset 9115
- Timestamp:
- 10/09/2008 09:49:00 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r9103 r9115 62 62 // insert the post with nothing in it, to get an ID 63 63 $post_ID = wp_insert_post($quick, true); 64 64 65 65 $content = $_REQUEST['content']; 66 66 … … 82 82 if ( is_wp_error($post_ID)) { 83 83 wp_die($id); 84 wp_delete_post($post_ID); error_log('2');84 wp_delete_post($post_ID); 85 85 // error handling for media_sideload 86 86 } elseif ( is_wp_error($upload)) { … … 98 98 check_admin_referer('press-this'); 99 99 $post_ID = press_it(); 100 error_log($post_ID);101 100 $posted = $post_ID; 102 //wp_redirect('press-this.php?posted=' . press_it());103 101 } 104 102 … … 126 124 <h2><label for="embed-code"><?php _e('Embed Code') ?></label></h2> 127 125 <div class="titlewrap" > 128 <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo $selection; ?></textarea> 129 126 <textarea name="embed-code" id="embed-code" rows="8" cols="40"><?php echo format_to_edit($selection, true); ?></textarea> 130 127 </div> 131 128 <p id="options"><a href="#" class="select button"><?php _e('Insert Video'); ?></a> <a href="#" class="close button"><?php _e('Cancel'); ?></a></p> … … 193 190 $sources = array(); 194 191 foreach ($matches[3] as $src) { 195 error_log($src);196 192 // if no http in url 197 193 if(strpos($src, 'http') === false) 198 194 // if it doesn't have a relative uri 199 if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === true)195 if( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) 200 196 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); 201 197 else 202 198 $src = 'http://'.str_replace('//','/', $host['host'].'/'.dirname($host['path']).'/'.$src); 203 204 199 $sources[] = clean_url($src); 205 error_log($src);206 200 } 207 201 return "'" . implode("','", $sources) . "'"; … … 261 255 insert_editor("\n\n" + '<p style="text-align: center;"><a href="<?php echo $url; ?>"><img src="' + img +'" alt="' + desc + '" /></a></p>'); 262 256 } 263 /*tinyMCE.activeEditor.resizeToContent();*/264 257 return false; 265 258 } … … 500 493 <textarea name="content" id="content" style="width:100%;" class="mceEditor" rows="15"> 501 494 <?php if ($selection) echo wp_richedit_pre($selection); ?> 502 < p>via <a href="<?php echo $url ?>"><?php echo $title; ?></a>.</p>495 <?php if ($url) { ?><p>via <a href="<?php echo $url ?>"><?php echo $title; ?></a>.</p><?php } ?> 503 496 </textarea> 504 497 </div>
Note: See TracChangeset
for help on using the changeset viewer.