WordPress.org

Make WordPress Core

Changeset 18721


Ignore:
Timestamp:
09/19/11 16:31:33 (3 years ago)
Author:
duck_
Message:

Make use of specific post format support in current_theme_supports(). See #18691.

Location:
trunk/wp-admin
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/includes/post.php

    r18632 r18721  
    192192 
    193193    // Post Formats 
    194     if ( current_theme_supports( 'post-formats' ) && isset( $post_data['post_format'] ) ) { 
    195         $formats = get_theme_support( 'post-formats' ); 
    196         if ( is_array( $formats ) ) { 
    197             $formats = $formats[0]; 
    198             if ( in_array( $post_data['post_format'], $formats ) ) { 
    199                 set_post_format( $post_ID, $post_data['post_format'] ); 
    200             } elseif ( '0' == $post_data['post_format'] ) { 
    201                 set_post_format( $post_ID, false ); 
    202             } 
    203         } 
     194    if ( isset( $post_data['post_format'] ) ) { 
     195        if ( current_theme_supports( 'post-formats', $post_data['post_format'] ) ) 
     196            set_post_format( $post_ID, $post_data['post_format'] ); 
     197        elseif ( '0' == $post_data['post_format'] ) 
     198            set_post_format( $post_ID, false ); 
    204199    } 
    205200 
  • trunk/wp-admin/press-this.php

    r18661 r18721  
    6464    } else { 
    6565        // Post formats 
    66         if ( current_theme_supports( 'post-formats' ) && isset( $_POST['post_format'] ) ) { 
    67             $post_formats = get_theme_support( 'post-formats' ); 
    68             if ( is_array( $post_formats ) ) { 
    69                 $post_formats = $post_formats[0]; 
    70                 if ( in_array( $_POST['post_format'], $post_formats ) ) 
    71                     set_post_format( $post_ID, $_POST['post_format'] ); 
    72                 elseif ( '0' == $_POST['post_format'] ) 
    73                     set_post_format( $post_ID, false ); 
    74             } 
     66        if ( isset( $_POST['post_format'] ) ) { 
     67            if ( current_theme_supports( 'post-formats', $_POST['post_format'] ) ) 
     68                set_post_format( $post_ID, $_POST['post_format'] ); 
     69            elseif ( '0' == $post_data['post_format'] ) 
     70                set_post_format( $post_ID, false ); 
    7571        } 
    7672 
Note: See TracChangeset for help on using the changeset viewer.