Ticket #15795: 15795.2.diff
File 15795.2.diff, 2.2 KB (added by , 14 years ago) |
---|
-
wp-admin/press-this.php
27 27 */ 28 28 function press_it() { 29 29 // define some basic variables 30 $quick = array(); 30 31 $quick['post_status'] = 'draft'; // set as draft first 31 32 $quick['post_category'] = isset($_POST['post_category']) ? $_POST['post_category'] : null; 32 33 $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null; … … 64 65 } else { 65 66 $quick['ID'] = $post_ID; 66 67 wp_update_post($quick); 68 69 // Post formats 70 if ( current_theme_supports( 'post-formats' ) && isset( $_POST['post_format'] ) ) { 71 $post_formats = get_theme_support( 'post-formats' ); 72 if ( is_array( $post_formats ) ) { 73 $post_formats = $post_formats[0]; 74 if ( in_array( $_POST['post_format'], $post_formats ) ) 75 set_post_format( $post_ID, $_POST['post_format'] ); 76 elseif ( '0' == $_POST['post_format'] ) 77 set_post_format( $post_ID, false ); 78 } 79 } 80 67 81 } 68 82 return $post_ID; 69 83 } … … 468 482 <div class="photolist"></div> 469 483 470 484 <div id="submitdiv" class="stuffbox"> 471 <div class="handlediv" title="<?php _e( 'Click to toggle' ); ?>">472 <br/>473 </div>474 <h3><?php _e('Publish') ?></h3>475 485 <div class="inside"> 476 486 <p> 477 487 <?php … … 484 494 } ?> 485 495 <img src="<?php echo esc_url( admin_url( 'images/wpspin_light.gif' ) ); ?>" alt="" id="saving" style="display:none;" /> 486 496 </p> 497 <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) : 498 $post_formats = get_theme_support( 'post-formats' ); 499 if ( is_array( $post_formats[0] ) ) : 500 ?> 501 <p> 502 <label for="post_format"><?php _e( 'Post Format:' ); ?> 503 <select name="post_format" id="post_format"> 504 <option value="0"><?php _e( 'Standard' ); ?></option> 505 <?php foreach ( $post_formats[0] as $format ): ?> 506 <option value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option> 507 <?php endforeach; ?> 508 </select></label> 509 </p> 510 <?php endif; endif; ?> 487 511 </div> 488 512 </div> 489 513