Make WordPress Core

Ticket #24219: 24219.2.patch

File 24219.2.patch, 2.7 KB (added by kovshenin, 12 years ago)
  • wp-admin/press-this.php

     
    6969        } else {
    7070                // Post formats
    7171                if ( isset( $_POST['post_format'] ) ) {
    72                         if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) )
     72                        if ( in_array( $_POST['post_format'], get_post_format_slugs() ) )
    7373                                set_post_format( $post_ID, $_POST['post_format'] );
    7474                        elseif ( '0' == $_POST['post_format'] )
    7575                                set_post_format( $post_ID, false );
     
    470470                                                <span class="spinner" style="display: none;"></span>
    471471                                        </p>
    472472                                        <?php if ( current_theme_supports( 'post-formats' ) && post_type_supports( 'post', 'post-formats' ) ) :
    473                                                         $post_formats = get_theme_support( 'post-formats' );
    474                                                         if ( is_array( $post_formats[0] ) ) :
    475                                                                 $default_format = get_option( 'default_post_format', '0' );
    476                                                 ?>
     473                                                $post_formats = get_post_format_strings();
     474                                                unset( $post_formats['standard'] ); ?>
    477475                                        <p>
    478476                                                <label for="post_format"><?php _e( 'Post Format:' ); ?>
    479477                                                <select name="post_format" id="post_format">
    480                                                         <option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option>
    481                                                 <?php foreach ( $post_formats[0] as $format ): ?>
    482                                                         <option<?php selected( $default_format, $format ); ?> value="<?php echo esc_attr( $format ); ?>"> <?php echo esc_html( get_post_format_string( $format ) ); ?></option>
     478                                                        <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option>
     479                                                <?php foreach ( $post_formats as $format_slug => $format_name ): ?>
     480                                                        <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option>
    483481                                                <?php endforeach; ?>
    484482                                                </select></label>
    485483                                        </p>
    486                                         <?php endif; endif; ?>
     484                                        <?php endif; ?>
    487485                                </div>
    488486                        </div>
    489487
  • wp-includes/class-wp-xmlrpc-server.php

     
    33693369
    33703370                # find out if they want a list of currently supports formats
    33713371                if ( isset( $args[3] ) && is_array( $args[3] ) ) {
    3372                         if ( $args[3]['show-supported'] ) {
    3373                                 if ( current_theme_supports( 'post-formats' ) ) {
    3374                                         $supported = get_theme_support( 'post-formats' );
    33753372
    3376                                         $data['all'] = $formats;
    3377                                         $data['supported'] = $supported[0];
    3378 
    3379                                         $formats = $data;
    3380                                 }
    3381                         }
     3373                        // All formats are supported since 3.6
     3374                        if ( ! empty( $args[3]['show-supported'] ) )
     3375                                $formats = array( 'all' => $formats, 'supported' => $formats );
    33823376                }
    33833377
    33843378                return $formats;