Ticket #35497: 35497.2.diff
| File 35497.2.diff, 6.9 KB (added by , 7 years ago) |
|---|
-
src/wp-admin/css/edit.css
862 862 11.4 - Post formats 863 863 ------------------------------------------------------------------------------*/ 864 864 865 .post-state-format { 866 overflow: hidden; 867 display: inline-block; 868 vertical-align: middle; 869 height: 20px; 870 width: 20px; 871 margin-right: 5px; 872 margin-top: -4px; 873 } 874 875 .post-state-format:before { 876 display: block; 877 height: 20px; 878 width: 20px; 879 font: normal 20px/1 dashicons !important; 880 speak: none; 881 -webkit-font-smoothing: antialiased; 882 -moz-osx-font-smoothing: grayscale; 883 } 884 885 .post-state-format:before, 886 .post-format-icon:before { 865 .post-format-icon::before { 887 866 color: #ddd; 888 867 transition: all .1s ease-in-out; 889 868 } 890 869 891 a.post-state-format:hover:before,892 a.post-format-icon:hover:before {893 color: #00a0d2;894 }895 896 870 #post-formats-select { 897 871 line-height: 2em; 898 872 } 899 873 900 #post-formats-select .post-format-icon: before {874 #post-formats-select .post-format-icon::before { 901 875 top: 5px; 902 876 } 903 877 … … 906 880 } 907 881 908 882 label.post-format-icon { 909 margin-left: 0 px;910 padding: 2px 0 2px 0px;883 margin-left: 0; 884 padding: 2px 0; 911 885 } 912 886 913 .post-format-icon: before {887 .post-format-icon::before { 914 888 position: relative; 915 889 display: inline-block; 916 890 margin-right: 7px; … … 920 894 -moz-osx-font-smoothing: grayscale; 921 895 } 922 896 923 .post-state-format.post-format-standard:before, 924 .post-format-icon.post-format-standard:before, 925 a.post-state-format.format-standard:before { 897 .post-format-icon.post-format-standard::before { 926 898 content: "\f109"; 927 899 } 928 900 929 .post-state-format.post-format-image:before, 930 .post-format-icon.post-format-image:before, 931 a.post-state-format.format-image:before { 901 .post-format-icon.post-format-image::before { 932 902 content: "\f128"; 933 903 } 934 904 935 .post-state-format.post-format-gallery:before, 936 .post-format-icon.post-format-gallery:before, 937 a.post-state-format.format-gallery:before { 905 .post-format-icon.post-format-gallery::before { 938 906 content: "\f161"; 939 907 } 940 908 941 .post-state-format.post-format-audio:before, 942 .post-format-icon.post-format-audio:before, 943 a.post-state-format.format-audio:before { 909 .post-format-icon.post-format-audio::before { 944 910 content: "\f127"; 945 911 } 946 912 947 .post-state-format.post-format-video:before, 948 .post-format-icon.post-format-video:before, 949 a.post-state-format.format-video:before { 913 .post-format-icon.post-format-video::before { 950 914 content: "\f126"; 951 915 } 952 916 953 .post-state-format.post-format-chat:before, 954 .post-format-icon.post-format-chat:before, 955 a.post-state-format.format-chat:before { 917 .post-format-icon.post-format-chat::before { 956 918 content: "\f125"; 957 919 } 958 920 959 .post-state-format.post-format-status:before, 960 .post-format-icon.post-format-status:before, 961 a.post-state-format.format-status:before { 921 .post-format-icon.post-format-status::before { 962 922 content: "\f130"; 963 923 } 964 924 965 .post-state-format.post-format-aside:before, 966 .post-format-icon.post-format-aside:before, 967 a.post-state-format.format-aside:before { 925 .post-format-icon.post-format-aside::before { 968 926 content: "\f123"; 969 927 } 970 928 971 .post-state-format.post-format-quote:before, 972 .post-format-icon.post-format-quote:before, 973 a.post-state-format.format-quote:before { 929 .post-format-icon.post-format-quote::before { 974 930 content: "\f122"; 975 931 } 976 932 977 .post-state-format.post-format-link:before, 978 .post-format-icon.post-format-link:before, 979 a.post-state-format.format-link:before { 933 .post-format-icon.post-format-link::before { 980 934 content: "\f103"; 981 935 } 982 936 -
src/wp-admin/css/ie.css
471 471 display: inline; 472 472 } 473 473 474 a.post-state-format {475 text-indent: 0;476 line-height: 0;477 font-size: 0;478 }479 480 474 table.ie-fixed { 481 475 table-layout: fixed; 482 476 } -
src/wp-admin/includes/class-wp-posts-list-table.php
459 459 } 460 460 461 461 /** 462 * Displays a formats dropdown for filtering items. 463 * 464 * @since 5.2.0 465 * @access protected 466 * 467 * @param string $post_type Post type key. 468 */ 469 protected function formats_dropdown( $post_type ) { 470 /** 471 * Filters whether to remove the 'Formats' drop-down from the post list table. 472 * 473 * @since 5.2.0 474 * 475 * @param bool $disable Whether to disable the drop-down. Default false. 476 */ 477 if ( apply_filters( 'disable_formats_dropdown', false ) ) { 478 return; 479 } 480 481 // Make sure the dropdown shows only formats with a post count greater than 0. 482 $used_post_formats = get_terms( 483 array( 484 'taxonomy' => 'post_format', 485 'hide_empty' => true, 486 ) 487 ); 488 489 /* 490 * Return if the post type doesn't have post formats, or there are no 491 * posts using formats, or if we're in the trash. 492 */ 493 if ( ! is_object_in_taxonomy( $post_type, 'post_format' ) || empty( $used_post_formats ) || $this->is_trash ) { 494 return; 495 } 496 497 $displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : ''; 498 ?> 499 <label for="filter-by-format" class="screen-reader-text"><?php _e( 'Filter by post format' ); ?></label> 500 <select name="post_format" id="filter-by-format"> 501 <option<?php selected( $displayed_post_format, '' ); ?> value=""><?php _e( 'All formats' ); ?></option> 502 <?php 503 foreach ( $used_post_formats as $used_post_format ) { 504 // Post format slug. 505 $slug = str_replace( 'post-format-', '', $used_post_format->slug ); 506 // Pretty, translated version of the post format slug. 507 $pretty_name = get_post_format_string( $slug ); 508 // Skip the standard post format. 509 if ( 'standard' === $slug ) { 510 continue; 511 } 512 ?> 513 <option<?php selected( $displayed_post_format, $slug ); ?> value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $pretty_name ); ?></option> 514 <?php 515 } 516 ?> 517 </select> 518 <?php 519 } 520 521 /** 462 522 * @param string $which 463 523 */ 464 524 protected function extra_tablenav( $which ) { … … 470 530 471 531 $this->months_dropdown( $this->screen->post_type ); 472 532 $this->categories_dropdown( $this->screen->post_type ); 533 $this->formats_dropdown( $this->screen->post_type ); 473 534 474 535 /** 475 536 * Fires before the Filter button on the Posts and Pages list tables. … … 943 1004 $pad = str_repeat( '— ', $this->current_level ); 944 1005 echo '<strong>'; 945 1006 946 $format = get_post_format( $post->ID );947 if ( $format ) {948 $label = get_post_format_string( $format );949 950 $format_class = 'post-state-format post-format-icon post-format-' . $format;951 952 $format_args = array(953 'post_format' => $format,954 'post_type' => $post->post_type,955 );956 957 echo $this->get_edit_link( $format_args, $label . ':', $format_class );958 }959 960 1007 $title = _draft_or_post_title(); 961 1008 962 1009 if ( $can_edit_post && $post->post_status != 'trash' ) {