Ticket #35497: 35497.3.diff
| File 35497.3.diff, 7.7 KB (added by , 7 years ago) |
|---|
-
src/wp-admin/css/edit.css
863 863 11.4 - Post formats 864 864 ------------------------------------------------------------------------------*/ 865 865 866 .post-state-format { 867 overflow: hidden; 866 .post-format-icon::before { 868 867 display: inline-block; 869 868 vertical-align: middle; 870 869 height: 20px; 871 870 width: 20px; 872 margin-right: 5px;873 871 margin-top: -4px; 874 } 875 876 .post-state-format:before { 877 display: block; 878 height: 20px; 879 width: 20px; 880 font: normal 20px/1 dashicons !important; 872 margin-right: 7px; 873 color: #ddd; 874 font: normal 20px/1 dashicons; 881 875 speak: none; 882 876 -webkit-font-smoothing: antialiased; 883 877 -moz-osx-font-smoothing: grayscale; 884 }885 886 .post-state-format:before,887 .post-format-icon:before {888 color: #ddd;889 878 transition: all .1s ease-in-out; 890 879 } 891 880 892 a.post-state-format:hover:before,893 881 a.post-format-icon:hover:before { 894 882 color: #00a0d2; 895 883 } … … 898 886 line-height: 2em; 899 887 } 900 888 901 #post-formats-select .post-format-icon: before {889 #post-formats-select .post-format-icon::before { 902 890 top: 5px; 903 891 } 904 892 … … 907 895 } 908 896 909 897 label.post-format-icon { 910 margin-left: 0 px;911 padding: 2px 0 2px 0px;898 margin-left: 0; 899 padding: 2px 0; 912 900 } 913 901 914 .post-format-icon:before { 915 position: relative; 916 display: inline-block; 917 margin-right: 7px; 918 font: normal 20px/1 dashicons; 919 speak: none; 920 -webkit-font-smoothing: antialiased; 921 -moz-osx-font-smoothing: grayscale; 922 } 923 924 .post-state-format.post-format-standard:before, 925 .post-format-icon.post-format-standard:before, 926 a.post-state-format.format-standard:before { 902 .post-format-icon.post-format-standard::before { 927 903 content: "\f109"; 928 904 } 929 905 930 .post-state-format.post-format-image:before, 931 .post-format-icon.post-format-image:before, 932 a.post-state-format.format-image:before { 906 .post-format-icon.post-format-image::before { 933 907 content: "\f128"; 934 908 } 935 909 936 .post-state-format.post-format-gallery:before, 937 .post-format-icon.post-format-gallery:before, 938 a.post-state-format.format-gallery:before { 910 .post-format-icon.post-format-gallery::before { 939 911 content: "\f161"; 940 912 } 941 913 942 .post-state-format.post-format-audio:before, 943 .post-format-icon.post-format-audio:before, 944 a.post-state-format.format-audio:before { 914 .post-format-icon.post-format-audio::before { 945 915 content: "\f127"; 946 916 } 947 917 948 .post-state-format.post-format-video:before, 949 .post-format-icon.post-format-video:before, 950 a.post-state-format.format-video:before { 918 .post-format-icon.post-format-video::before { 951 919 content: "\f126"; 952 920 } 953 921 954 .post-state-format.post-format-chat:before, 955 .post-format-icon.post-format-chat:before, 956 a.post-state-format.format-chat:before { 922 .post-format-icon.post-format-chat::before { 957 923 content: "\f125"; 958 924 } 959 925 960 .post-state-format.post-format-status:before, 961 .post-format-icon.post-format-status:before, 962 a.post-state-format.format-status:before { 926 .post-format-icon.post-format-status::before { 963 927 content: "\f130"; 964 928 } 965 929 966 .post-state-format.post-format-aside:before, 967 .post-format-icon.post-format-aside:before, 968 a.post-state-format.format-aside:before { 930 .post-format-icon.post-format-aside::before { 969 931 content: "\f123"; 970 932 } 971 933 972 .post-state-format.post-format-quote:before, 973 .post-format-icon.post-format-quote:before, 974 a.post-state-format.format-quote:before { 934 .post-format-icon.post-format-quote::before { 975 935 content: "\f122"; 976 936 } 977 937 978 .post-state-format.post-format-link:before, 979 .post-format-icon.post-format-link:before, 980 a.post-state-format.format-link:before { 938 .post-format-icon.post-format-link::before { 981 939 content: "\f103"; 982 940 } 983 941 -
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 ); 1007 $format = get_post_format( $post->ID ); 1008 $format_classes = ( $format ) ? 'post-format-icon post-format-' . esc_attr( $format ) : ''; 949 1009 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 1010 $title = _draft_or_post_title(); 961 1011 962 1012 if ( $can_edit_post && $post->post_status != 'trash' ) { 963 1013 printf( 964 '<a class="row-title" href="%s" aria-label="%s">%s%s</a>', 1014 '<a class="row-title %s" href="%s" aria-label="%s">%s%s</a>', 1015 $format_classes, 965 1016 get_edit_post_link( $post->ID ), 966 1017 /* translators: %s: post title */ 967 1018 esc_attr( sprintf( __( '“%s” (Edit)' ), $title ) ), … … 969 1020 $title 970 1021 ); 971 1022 } else { 972 echo $pad . $title; 1023 printf( 1024 '<span class="%s">%s%s</span>', 1025 $format_classes, 1026 $pad, 1027 $title 1028 ); 973 1029 } 974 1030 _post_states( $post ); 975 1031