WordPress.org

Make WordPress Core

Ticket #15882: 15882.diff

File 15882.diff, 3.3 KB (added by nacin, 7 years ago)
  • wp-admin/includes/schema.php

     
    327327                $options[ 'permalink_structure' ] = '/%year%/%monthnum%/%day%/%postname%/';
    328328        }
    329329
     330        // 3.1
     331        'default_post_format' => 0,
     332
    330333        // Set autoload to no for these options
    331334        $fat_options = array( 'moderation_keys', 'recently_edited', 'blacklist_keys' );
    332335
  • wp-admin/includes/meta-boxes.php

     
    247247        if ( is_array( $post_formats[0] ) ) :
    248248                $post_format = get_post_format( $post->ID );
    249249                if ( !$post_format )
    250                         $post_format = '0';
     250                        $post_format = get_option('default_post_format', '0');
    251251                $post_format_display = get_post_format_string( $post_format );
    252252                // Add in the current one if it isn't there yet, in case the current theme doesn't support it
    253253                if ( $post_format && !in_array( $post_format, $post_formats[0] ) )
  • wp-admin/options.php

     
    6060        'media' => array( 'thumbnail_size_w', 'thumbnail_size_h', 'thumbnail_crop', 'medium_size_w', 'medium_size_h', 'large_size_w', 'large_size_h', 'image_default_size', 'image_default_align', 'image_default_link_type', 'embed_autourls', 'embed_size_w', 'embed_size_h' ),
    6161        'privacy' => array( 'blog_public' ),
    6262        'reading' => array( 'posts_per_page', 'posts_per_rss', 'rss_use_excerpt', 'blog_charset', 'show_on_front', 'page_on_front', 'page_for_posts' ),
    63         'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'enable_app', 'enable_xmlrpc' ),
     63        'writing' => array( 'default_post_edit_rows', 'use_smilies', 'default_category', 'default_email_category', 'use_balanceTags', 'default_link_category', 'default_post_format', 'enable_app', 'enable_xmlrpc' ),
    6464        'options' => array( '' ) );
    6565
    6666$mail_options = array('mailserver_url', 'mailserver_port', 'mailserver_login', 'mailserver_pass');
  • wp-admin/options-writing.php

     
    5656?>
    5757</td>
    5858</tr>
     59<?php
     60if ( current_theme_supports( 'post-formats' ) ) :
     61        $post_formats = get_theme_support( 'post-formats' );
     62        if ( is_array( $post_formats[0] ) ) :
     63?>
    5964<tr valign="top">
     65<th scope="row"><label for="default_post_format"><?php _e('Default Post Format') ?></label></th>
     66<td>
     67        <select name="default_post_format" id="default_post_format">
     68                <option value="0"><?php _e('Standard'); ?></option>
     69<?php foreach ( $post_formats[0] as $format ): ?>
     70                <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>
     71<?php endforeach; ?>
     72        </select></label>
     73</td>
     74</tr>
     75<?php endif; endif; ?>
     76<tr valign="top">
    6077<th scope="row"><label for="default_link_category"><?php _e('Default Link Category') ?></label></th>
    6178<td>
    6279<?php