Changeset 24264
- Timestamp:
- 05/15/2013 08:43:09 PM (13 years ago)
- Location:
- trunk/wp-admin
- Files:
-
- 5 edited
-
admin-header.php (modified) (1 diff)
-
css/wp-admin.css (modified) (2 diffs)
-
edit-form-advanced.php (modified) (4 diffs)
-
includes/post-formats.php (modified) (1 diff)
-
js/post-formats.js (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/admin-header.php
r24243 r24264 96 96 97 97 $admin_body_class .= ' wp-format-' . $post_format; 98 99 $show_post_format_ui = false; 100 101 if ( apply_filters( 'enable_post_format_ui', true, $post ) ) { 102 103 // If the user has explicitly set a screen option, use it, otherwise the UI is shown 104 // when the theme supports formats, or if the site has formats assigned to posts. 105 $post_format_user_option = get_user_option( 'post_formats_' . $post->post_type ); 106 if ( false !== $post_format_user_option ) 107 $show_post_format_ui = (bool) $post_format_user_option; 108 else 109 $show_post_format_ui = current_theme_supports( 'post-formats' ) || (bool) get_terms( 'post_format', array( 'number' => 1 ) ); 110 } 111 112 if ( $show_post_format_ui ) 113 $admin_body_class .= ' wp-post-format-show-ui'; 98 114 } 99 115 -
trunk/wp-admin/css/wp-admin.css
r24258 r24264 3996 3996 } 3997 3997 3998 . no-ui {3998 .wp-post-format-ui { 3999 3999 display: none; 4000 } 4001 4002 .wp-post-format-show-ui .wp-post-format-ui { 4003 display: block; 4000 4004 } 4001 4005 … … 4112 4116 } 4113 4117 4114 body.wp-format-image .attachment-display-settings,4115 body.wp-format-status #titlewrap,4116 body.wp-format-image .wp-media-buttons .insert-media,4117 body.wp-format-audio .wp-media-buttons .insert-media,4118 body.wp-format-video .wp-media-buttons .insert-media,4119 body.wp-format-aside .wp-media-buttons .insert-media,4120 body.wp-format-status .wp-media-buttons .insert-media{4118 .wp-post-format-show-ui.wp-format-image .attachment-display-settings, 4119 .wp-post-format-show-ui.wp-format-status #titlewrap, 4120 .wp-post-format-show-ui.wp-format-image #insert-media-button, 4121 .wp-post-format-show-ui.wp-format-audio #insert-media-button, 4122 .wp-post-format-show-ui.wp-format-video #insert-media-button, 4123 .wp-post-format-show-ui.wp-format-aside #insert-media-button, 4124 .wp-post-format-show-ui.wp-format-status #insert-media-button { 4121 4125 display: none; 4122 4126 } -
trunk/wp-admin/edit-form-advanced.php
r24184 r24264 131 131 $post_format = ''; 132 132 $post_format_options = ''; 133 $show_post_format_ui = false;134 133 if ( post_type_supports( $post_type, 'post-formats' ) && apply_filters( 'enable_post_format_ui', true, $post ) ) { 135 134 wp_enqueue_script( 'post-formats' ); … … 143 142 if ( ! empty( $_REQUEST['format'] ) && in_array( $_REQUEST['format'], get_post_format_slugs() ) ) 144 143 $post_format = $_REQUEST['format']; 145 }146 147 $user_wants = get_user_option( 'post_formats_' . $post_type );148 if ( false !== $user_wants ) {149 // User wants what user gets.150 $show_post_format_ui = (bool) $user_wants;151 } else {152 // UI is shown when the theme supports formats, or if the site has formats assigned to posts.153 $show_post_format_ui = current_theme_supports( 'post-formats' ) || get_terms( 'post_format', array( 'number' => 1 ) );154 144 } 155 145 … … 390 380 </div> 391 381 <?php if ( ! empty( $post_format_options ) ) : ?> 392 <div class="wp-post-format-ui <?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>">382 <div class="wp-post-format-ui"> 393 383 <div class="post-format-options"> 394 384 <?php echo $post_format_options; ?> … … 423 413 <div id="post-body-content"<?php echo $format_class; ?>> 424 414 <?php if ( ! empty( $all_post_formats ) ) : ?> 425 <div class="wp-post-format-ui <?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>">415 <div class="wp-post-format-ui"> 426 416 <div class="post-format-change"><span class="icon <?php echo esc_attr( 'wp-format-' . $post_format ); ?>"></span> <span class="post-format-description"><?php echo $all_post_formats[$post_format]['description']; ?></span></div> 427 417 </div> -
trunk/wp-admin/includes/post-formats.php
r24258 r24264 10 10 11 11 ?> 12 <div class="wp-post-format-ui <?php if ( ! $show_post_format_ui ) echo ' no-ui' ?>">12 <div class="wp-post-format-ui"> 13 13 <div class="post-formats-fields"> 14 14 -
trunk/wp-admin/js/post-formats.js
r24236 r24264 211 211 212 212 $( '#show_post_format_ui' ).on( 'change', function () { 213 $( '.wp-post-format-ui' ).toggleClass( 'no-ui', ! this.checked ); 213 body.toggleClass( 'wp-post-format-show-ui', this.checked ); 214 215 // Reset the display properties of possibly hidden items. 216 insertMediaButton.css( 'display', '' ); 217 $( '#titlewrap' ).css( 'display', '' ); 218 214 219 $.post( ajaxurl, { 215 220 action: 'show-post-format-ui',
Note: See TracChangeset
for help on using the changeset viewer.