Ticket #18083: 18083.diff
| File 18083.diff, 3.9 KB (added by duck_, 21 months ago) |
|---|
-
wp-admin/includes/class-wp-posts-list-table.php
988 988 989 989 </div> 990 990 991 <?php if ( post_type_supports( $screen->post_type, 'post-formats' ) && current_theme_supports( 'post-formats' ) ) : 992 $post_formats = get_theme_support( 'post-formats' ); 993 if ( is_array( $post_formats[0] ) ) : ?> 994 <div class="inline-edit-group"> 995 <label class="alignleft" for="post_format"> 996 <span class="title"><?php _e( 'Post Format' ); ?></span> 997 <select name="post_format" id="post_format"> 998 <?php if ( $bulk ) : ?> 999 <option value="-1"><?php _e( '— No Change —' ); ?></option> 1000 <?php endif; ?> 1001 <option value="0"><?php _ex( 'Standard', 'Post format' ); ?></option> 1002 <?php foreach ( $post_formats[0] as $format ): ?> 1003 <option value="<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></option> 1004 <?php endforeach; ?> 1005 </select></label> 1006 </div> 1007 <?php endif; ?> 1008 <?php endif; // post-formats ?> 1009 991 1010 </div></fieldset> 992 1011 993 1012 <?php -
wp-admin/includes/post.php
312 312 foreach ( $post_data['tax_input'] as $tax_name => $terms ) { 313 313 if ( empty($terms) ) 314 314 continue; 315 if ( is_taxonomy_hierarchical( $tax_name ) ) 315 if ( is_taxonomy_hierarchical( $tax_name ) ) { 316 316 $tax_input[$tax_name] = array_map( 'absint', $terms ); 317 else {317 } else { 318 318 $tax_input[$tax_name] = preg_replace( '/\s*,\s*/', ',', rtrim( trim($terms), ' ,' ) ); 319 319 $tax_input[$tax_name] = explode(',', $tax_input[$tax_name]); 320 320 } … … 337 337 } 338 338 } 339 339 340 // don't change the post format if it's not supported, unset or set to -1 341 if ( isset( $post_data['post_format'] ) && '-1' != $post_data['post_format'] && current_theme_supports( 'post-formats' ) ) { 342 $formats = get_theme_support( 'post-formats' ); 343 if ( is_array( $formats ) ) { 344 $formats = $formats[0]; 345 if ( ! in_array( $post_data['post_format'], $formats ) ) { 346 unset( $post_data['post_format'] ); 347 } 348 } 349 } else { 350 unset( $post_data['post_format'] ); 351 } 352 340 353 $updated = $skipped = $locked = array(); 341 354 foreach ( $post_IDs as $post_ID ) { 342 355 $post_type_object = get_post_type_object( get_post_type( $post_ID ) ); … … 387 400 unstick_post( $post_ID ); 388 401 } 389 402 403 if ( isset( $post_data['post_format'] ) ) 404 set_post_format( $post_ID, $post_data['post_format'] ); 390 405 } 391 406 392 407 return array( 'updated' => $updated, 'skipped' => $skipped, 'locked' => $locked ); -
wp-admin/includes/template.php
310 310 if ( !$post_type_object->hierarchical ) 311 311 echo '<div class="sticky">' . (is_sticky($post->ID) ? 'sticky' : '') . '</div>'; 312 312 313 if ( post_type_supports( $post->post_type, 'post-formats' ) ) 314 echo '<div class="post_format">' . esc_html( get_post_format( $post->ID ) ) . '</div>'; 315 313 316 echo '</div>'; 314 317 } 315 318 -
wp-admin/js/inline-edit-post.dev.js
129 129 if ( typeof(id) == 'object' ) 130 130 id = t.getId(id); 131 131 132 fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password' ];132 fields = ['post_title', 'post_name', 'post_author', '_status', 'jj', 'mm', 'aa', 'hh', 'mn', 'ss', 'post_password', 'post_format']; 133 133 if ( t.type == 'page' ) 134 134 fields.push('post_parent', 'menu_order', 'page_template'); 135 135
