WordPress.org

Make WordPress Core


Ignore:
Timestamp:
11/04/2010 07:41:07 AM (9 years ago)
Author:
markjaquith
Message:

add_theme_support( 'post-formats', array( 'aside', 'image', 'etc' ) ); Add UI for choosing a post format, and save the choice. see #14746

File:
1 edited

Legend:

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

    r16133 r16174  
    175175                unset( $post_data['sticky'] );
    176176                break;
     177        }
     178    }
     179
     180    // Post Formats
     181    if ( current_theme_supports( 'post-formats' ) && isset( $post_data['post_format'] ) ) {
     182        $formats = get_theme_support( 'post-formats' );
     183        if ( is_array( $formats ) ) {
     184            $formats = $formats[0];
     185            if ( in_array( $post_data['post_format'], $formats ) ) {
     186                set_post_format( $post_ID, $post_data['post_format'] );
     187            } elseif ( '0' == $post_data['post_format'] ) {
     188                set_post_format( $post_ID, false );
     189            }
    177190        }
    178191    }
Note: See TracChangeset for help on using the changeset viewer.