WordPress.org

Make WordPress Core

Changeset 24089


Ignore:
Timestamp:
04/25/13 06:08:29 (2 years ago)
Author:
markjaquith
Message:

Allow any post format to be default, not just ones with explicit support.

props SergeyBiryukov. fixes #24036.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/options-writing.php

    r24002 r24089  
    8080</tr> 
    8181<?php 
    82 if ( current_theme_supports( 'post-formats' ) ) : 
    83     $post_formats = get_theme_support( 'post-formats' ); 
    84     if ( is_array( $post_formats[0] ) ) : 
     82$post_formats = get_post_format_strings(); 
     83unset( $post_formats['standard'] ); 
    8584?> 
    8685<tr valign="top"> 
     
    8887<td> 
    8988    <select name="default_post_format" id="default_post_format"> 
    90         <option value="0"><?php _e('Standard'); ?></option> 
    91 <?php foreach ( $post_formats[0] as $format ): ?> 
    92         <option<?php selected( get_option('default_post_format'), $format ); ?> value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option> 
     89        <option value="0"><?php echo get_post_format_string( 'standard' ); ?></option> 
     90<?php foreach ( $post_formats as $format_slug => $format_name ): ?> 
     91        <option<?php selected( get_option( 'default_post_format' ), $format_slug ); ?> value="<?php echo esc_attr( $format_slug ); ?>"><?php echo esc_html( $format_name ); ?></option> 
    9392<?php endforeach; ?> 
    9493    </select> 
    9594</td> 
    9695</tr> 
    97 <?php endif; endif; 
    98  
     96<?php 
    9997if ( get_option( 'link_manager_enabled' ) ) : 
    10098?> 
Note: See TracChangeset for help on using the changeset viewer.