Make WordPress Core

Ticket #15795: 15795-2.diff

File 15795-2.diff, 2.0 KB (added by greuben, 14 years ago)
  • wp-admin/press-this.php

     
    3232        $quick['tax_input'] = isset($_POST['tax_input']) ? $_POST['tax_input'] : null;
    3333        $quick['post_title'] = ( trim($_POST['title']) != '' ) ? $_POST['title'] : '  ';
    3434        $quick['post_content'] = isset($_POST['post_content']) ? $_POST['post_content'] : '';
     35        $post_format = isset($_POST['post_format']) ? $_POST['post_format'] : 'standard';
    3536
    3637        // insert the post with nothing in it, to get an ID
    3738        $post_ID = wp_insert_post($quick, true);
     
    6465        } else {
    6566                $quick['ID'] = $post_ID;
    6667                wp_update_post($quick);
     68                set_post_format( $post_ID, $post_format);
    6769        }
    6870        return $post_ID;
    6971}
     
    486488                                        </p>
    487489                                </div>
    488490                        </div>
     491                       
     492                        <?php if ( current_theme_supports( 'post-formats' ) ): ?>
     493                        <div id="formatdiv" class="postbox">
     494                                <div class="handlediv" title="<?php _e('Click to toggle'); ?>">
     495                                        <br />
     496                                </div>
     497                                <h3><?php _e('Format'); ?></h3>
     498                                <div class="inside">
     499                                        <div id="post-formats-select">
     500                                                <?php
     501                                                        $post_formats = get_theme_support( 'post-formats' );
     502                                                        if( is_array( $post_formats[0] ) ):                                                             
     503                                                ?>
     504                                                <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>
     505                                                <?php foreach( $post_formats[0] as $format ): ?>
     506                                                <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>
     507                                                <?php endforeach; ?>
     508                                                <br />
     509                                                <?php endif; ?>                                                 
     510                                        </div>
     511                                </div>
     512                        </div>
     513                        <?php endif; ?>
    489514
    490515                        <?php $tax = get_taxonomy( 'category' ); ?>
    491516                        <div id="categorydiv" class="postbox">