Changeset 10855
- Timestamp:
- 04/01/2009 05:41:52 AM (16 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/css/press-this.css
r10290 r10855 15 15 padding-top: 4px; 16 16 background: #444 !important; 17 } 18 19 .tagchecklist span a { 20 background: transparent url(../images/xit.gif) no-repeat 0 0; 17 21 } 18 22 -
trunk/wp-admin/press-this.php
r10810 r10855 11 11 header('Content-Type: ' . get_option('html_type') . '; charset=' . get_option('blog_charset')); 12 12 13 if ( ! current_user_can(' publish_posts') ) wp_die( __( 'Cheatin’ uh?' ) );13 if ( ! current_user_can('edit_posts') ) wp_die( __( 'Cheatin’ uh?' ) ); 14 14 15 15 /** … … 65 65 $content = $_REQUEST['content']; 66 66 67 if( $_REQUEST['photo_src'])67 if( $_REQUEST['photo_src'] && current_user_can('upload_files') ) 68 68 foreach( (array) $_REQUEST['photo_src'] as $key => $image) 69 69 // see if files exist in content - we don't want to upload non-used selected files. 70 70 if( strpos($_REQUEST['content'], $image) !== false ) { 71 71 $upload = media_sideload_image($image, $post_ID, $_REQUEST['photo_description'][$key]); 72 73 // Replace the POSTED content <img> with correct uploaded ones. 74 // escape quote for matching 75 $quoted = preg_quote2($image); 76 if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=(\"|\')'.$quoted.'(\2)([^>\/]*)\/*>/is', $upload, $content); 72 73 // Replace the POSTED content <img> with correct uploaded ones. Regex contains fix for Magic Quotes 74 if( !is_wp_error($upload) ) $content = preg_replace('/<img ([^>]*)src=\\\?(\"|\')'.preg_quote2($image).'\\\?(\2)([^>\/]*)\/*>/is', $upload, $content); 77 75 } 78 76 … … 462 460 <!-- This div holds the photo metadata --> 463 461 <div class="photolist"></div> 464 462 463 <div id="submitdiv" class="stuffbox"> 464 <h3><?php _e('Publish') ?></h3> 465 <div class="inside"> 466 <p> 467 <input class="button" type="submit" name="draft" value="<?php _e('Save Draft') ?>" id="save" /> 468 <?php if ( current_user_can('publish_posts') ) { ?> 469 <input class="button-primary" type="submit" name="publish" value="<?php _e('Publish') ?>" id="publish" /> 470 <?php } else { ?> 471 <br /><br /><input class="button-primary" type="submit" name="review" value="<?php _e('Submit for Review') ?>" id="review" /> 472 <?php } ?> 473 <img src="images/loading-publish.gif" alt="" id="saving" style="display:none;" /> 474 </p> 475 </div> 476 </div> 477 465 478 <div id="categorydiv" class="stuffbox"> 466 479 <h3><?php _e('Categories') ?></h3> … … 503 516 </div> 504 517 </div> 505 <div id="submitdiv" class="stuffbox">506 <h3><?php _e('Publish') ?></h3>507 <div class="inside">508 <p>509 <input class="button" type="submit" name="draft" value="<?php _e('Save Draft') ?>" id="save" />510 <input class="button-primary" type="submit" name="publish" value="<?php _e('Publish') ?>" id="publish" />511 <img src="images/loading-publish.gif" alt="" id="saving" style="display:none;" />512 </p>513 </div>514 </div>515 518 </div> 516 519 </div> … … 531 534 <div class="postdivrich"> 532 535 <ul id="actions"> 536 533 537 <li id="photo_button"> 534 Add: < a title="<?php _e('Insert an Image'); ?>" href="#">538 Add: <?php if ( current_user_can('upload_files') ) { ?><a title="<?php _e('Insert an Image'); ?>" href="#"> 535 539 <img alt="<?php _e('Insert an Image'); ?>" src="images/media-button-image.gif"/></a> 540 <?php } ?> 536 541 </li> 537 542 <li id="video_button"> -
trunk/wp-admin/tools.php
r10746 r10855 78 78 </div> 79 79 80 <?php if ( current_user_can(' publish_posts') ) : ?>80 <?php if ( current_user_can('edit_posts') ) : ?> 81 81 <div class="tool-box"> 82 82 <h3 class="title"><?php _e('Press This') ?></h3>
Note: See TracChangeset
for help on using the changeset viewer.