Changeset 17065
- Timestamp:
- 12/19/2010 09:12:13 PM (14 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/press-this.php
r16900 r17065 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; … … 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; … … 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> … … 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 $default_format = get_option( 'default_post_format', '0' ); 501 ?> 502 <p> 503 <label for="post_format"><?php _e( 'Post Format:' ); ?> 504 <select name="post_format" id="post_format"> 505 <option value="0"><?php _e( 'Standard' ); ?></option> 506 <?php foreach ( $post_formats[0] as $format ): ?> 507 <option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option> 508 <?php endforeach; ?> 509 </select></label> 510 </p> 511 <?php endif; endif; ?> 487 512 </div> 488 513 </div>
Note: See TracChangeset
for help on using the changeset viewer.