Make WordPress Core


Ignore:
Timestamp:
04/25/2013 07:28:33 AM (13 years ago)
Author:
markjaquith
Message:

Screen option for Post Format UI.

props nacin. see #23930.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-admin/edit-form-advanced.php

    r24084 r24092  
    147147    }
    148148
     149    $user_wants = get_user_option( 'post_formats_' . $post_type );
     150    if ( false !== $user_wants ) {
     151        // User wants what user gets.
     152        $show_post_format_ui = (bool) $user_wants;
     153    } else {
     154        // UI is shown when the theme supports formats, or if the site has formats assigned to posts.
     155        $show_post_format_ui = current_theme_supports( 'post-formats' ) || get_terms( 'post_format', array( 'number' => 1 ) );
     156    }
     157
    149158    $format_class = " class='wp-format-{$post_format}'";
    150159
     
    384393</div>
    385394<?php if ( ! empty( $post_format_options ) ) : ?>
    386 <div class="post-format-options">
    387     <?php echo $post_format_options; ?>
     395<div class="wp-post-format-ui<?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>">
     396    <div class="post-format-options">
     397        <?php echo $post_format_options; ?>
     398    </div>
    388399</div>
    389400<?php endif; ?>
Note: See TracChangeset for help on using the changeset viewer.