Changeset 29206 for trunk/src/wp-admin/press-this.php
- Timestamp:
- 07/17/2014 09:13:53 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/press-this.php
r27772 r29206 41 41 if ( !empty($_POST['photo_src']) && current_user_can('upload_files') ) { 42 42 foreach( (array) $_POST['photo_src'] as $key => $image) { 43 // see if files exist in content - we don't want to upload non-used selected files.43 // See if files exist in content - we don't want to upload non-used selected files. 44 44 if ( strpos($_POST['content'], htmlspecialchars($image)) !== false ) { 45 45 $desc = isset($_POST['photo_description'][$key]) ? $_POST['photo_description'][$key] : ''; … … 52 52 } 53 53 } 54 // set the post_content and status54 // Set the post_content and status. 55 55 $post['post_content'] = $content; 56 56 if ( isset( $_POST['publish'] ) && current_user_can( 'publish_posts' ) ) … … 61 61 $post['post_status'] = 'draft'; 62 62 63 // error handling for media_sideload63 // Error handling for media_sideload. 64 64 if ( is_wp_error($upload) ) { 65 65 wp_delete_post($post_ID); 66 66 wp_die($upload); 67 67 } else { 68 // Post formats 68 // Post formats. 69 69 if ( isset( $_POST['post_format'] ) ) { 70 70 if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) ) … … 182 182 $sources = array(); 183 183 foreach ($matches[3] as $src) { 184 // if no http in url 184 185 // If no http in URL. 185 186 if (strpos($src, 'http') === false) 186 // if it doesn't have a relative uri187 // If it doesn't have a relative URI. 187 188 if ( strpos($src, '../') === false && strpos($src, './') === false && strpos($src, '/') === 0) 188 189 $src = 'http://'.str_replace('//','/', $host['host'].'/'.$src); … … 198 199 199 200 case 'photo_js': ?> 200 // gather images and load some default JS201 // Gather images and load some default JS. 201 202 var last = null 202 203 var img, img_tag, aspect, w, h, skip, i, strtoappend = ""; … … 439 440 } 440 441 jQuery(document).ready(function($) { 441 // resize screen442 // Resize screen. 442 443 window.resizeTo(760,580); 443 // set button actions 444 445 // Set button actions. 444 446 jQuery('#photo_button').click(function() { show('photo'); return false; }); 445 447 jQuery('#video_button').click(function() { show('video'); return false; }); 446 // auto select 448 449 // Auto select. 447 450 <?php if ( preg_match("/youtube\.com\/watch/i", $url) ) { ?> 448 451 show('video');
Note: See TracChangeset
for help on using the changeset viewer.