Ticket #15795: 15795-4.diff
| File 15795-4.diff, 2.1 KB (added by , 15 years ago) |
|---|
-
wp-admin/press-this.php
32 32 $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null; 33 33 $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : ' '; 34 34 $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : ''; 35 $post_format = isset( $_POST['post_format'] ) ? $_POST['post_format'] : false; 35 36 36 37 // insert the post with nothing in it, to get an ID 37 38 $post_ID = wp_insert_post($quick, true); … … 64 65 } else { 65 66 $quick['ID'] = $post_ID; 66 67 wp_update_post($quick); 68 $post_formats = get_theme_support('post-formats'); 69 if( is_array( $post_formats ) && $post_format ){ 70 $post_formats = $post_formats[0]; 71 if( in_array( $post_format, $post_formats) ){ 72 set_post_format( $post_ID, $post_format); 73 } elseif( '0' == $post_format ){ 74 set_post_format( $post_ID, false ); 75 } 76 } 67 77 } 68 78 return $post_ID; 69 79 } … … 486 496 </p> 487 497 </div> 488 498 </div> 499 500 <?php if ( current_theme_supports( 'post-formats' ) ): ?> 501 <div id="formatdiv" class="postbox"> 502 <div class="handlediv" title="<?php _e('Click to toggle'); ?>"> 503 <br /> 504 </div> 505 <h3><?php _e('Format'); ?></h3> 506 <div class="inside"> 507 <div id="post-formats-select"> 508 <?php 509 $post_formats = get_theme_support( 'post-formats' ); 510 if( is_array( $post_formats[0] ) ): 511 ?> 512 <select name="post_format" id="post_format"> 513 <option value="0" selected="selected" /><?php _e('Standard'); ?></option> 514 <?php foreach( $post_formats[0] as $format ): ?> 515 <option value="<?php echo esc_attr( $format ); ?>" /> <?php echo esc_html( get_post_format_string( $format ) ); ?></option> 516 <?php endforeach; ?> 517 </select> 518 <br /> 519 <?php endif; ?> 520 </div> 521 </div> 522 </div> 523 <?php endif; ?> 489 524 490 525 <?php $tax = get_taxonomy( 'category' ); ?> 491 526 <div id="categorydiv" class="postbox">