Ticket #15795: 15795-3.diff
File 15795-3.diff, 2.2 KB (added by , 14 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 } 67 74 } 68 75 return $post_ID; 69 76 } … … 486 493 </p> 487 494 </div> 488 495 </div> 496 497 <?php if ( current_theme_supports( 'post-formats' ) ): ?> 498 <div id="formatdiv" class="postbox"> 499 <div class="handlediv" title="<?php _e('Click to toggle'); ?>"> 500 <br /> 501 </div> 502 <h3><?php _e('Format'); ?></h3> 503 <div class="inside"> 504 <div id="post-formats-select"> 505 <?php 506 $post_formats = get_theme_support( 'post-formats' ); 507 if( is_array( $post_formats[0] ) ): 508 ?> 509 <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" checked="checked" /> <label for="post-format-0"><?php _e('Standard'); ?></label> 510 <?php foreach( $post_formats[0] as $format ): ?> 511 <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> 512 <?php endforeach; ?> 513 <br /> 514 <?php endif; ?> 515 </div> 516 </div> 517 </div> 518 <?php endif; ?> 489 519 490 520 <?php $tax = get_taxonomy( 'category' ); ?> 491 521 <div id="categorydiv" class="postbox">