Ticket #24327: 24327.diff
| File 24327.diff, 5.6 KB (added by , 13 years ago) |
|---|
-
wp-admin/css/wp-admin.css
3995 3995 padding-bottom: 0; 3996 3996 } 3997 3997 3998 . no-ui {3998 .wp-post-format-ui { 3999 3999 display: none; 4000 4000 } 4001 4001 4002 .wp-post-format-show-ui .wp-post-format-ui { 4003 display: block; 4004 } 4005 4002 4006 .post-formats-fields { 4003 4007 display: none; 4004 4008 margin-bottom: 15px; … … 4111 4115 text-align: center; 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 } 4123 4127 -
wp-admin/admin-header.php
95 95 } 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 100 116 if ( wp_is_mobile() ) -
wp-admin/js/post-formats.js
210 210 } 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', 216 221 post_type: $( '#post_type' ).val(), -
wp-admin/edit-form-advanced.php
130 130 $format_class = ''; 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' ); 136 135 wp_enqueue_script( 'wp-mediaelement' ); … … 144 143 $post_format = $_REQUEST['format']; 145 144 } 146 145 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 }155 156 146 $format_class = " class='wp-format-{$post_format}'"; 157 147 158 148 $all_post_formats = array( … … 389 379 <p><?php _e("You have lost your connection with the server, and saving has been disabled. This message will vanish once you've reconnected."); ?></p> 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; ?> 395 385 </div> … … 422 412 <div id="post-body" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>"> 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> 428 418 <?php endif; ?> -
wp-admin/includes/post-formats.php
9 9 wp_nonce_field( 'show-post-format-ui_' . $post_type, 'show_post_format_ui_nonce', false ); 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 15 15 <input type="hidden" name="post_format" id="post_format" value="<?php echo esc_attr( $post_format ); ?>" />