Ticket #35497: 35497.diff
| File 35497.diff, 6.7 KB (added by , 9 years ago) |
|---|
-
src/wp-admin/css/edit.css
772 772 11.4 - Post formats 773 773 ------------------------------------------------------------------------------*/ 774 774 775 .post-state-format {776 overflow: hidden;777 display: inline-block;778 vertical-align: middle;779 height: 20px;780 width: 20px;781 margin-right: 5px;782 margin-top: -4px;783 }784 785 .post-state-format:before {786 display: block;787 height: 20px;788 width: 20px;789 font: normal 20px/1 dashicons !important;790 speak: none;791 -webkit-font-smoothing: antialiased;792 -moz-osx-font-smoothing: grayscale;793 }794 795 .post-state-format:before,796 775 .post-format-icon:before { 797 776 color: #ddd; 798 777 -webkit-transition: all .1s ease-in-out; … … 799 778 transition: all .1s ease-in-out; 800 779 } 801 780 802 a.post-state-format:hover:before,803 a.post-format-icon:hover:before {804 color: #00a0d2;805 }806 807 781 #post-formats-select { 808 782 line-height: 2em; 809 783 } … … 817 791 } 818 792 819 793 label.post-format-icon { 820 margin-left: 0 px;821 padding: 2px 0 2px 0px;794 margin-left: 0; 795 padding: 2px 0; 822 796 } 823 797 824 798 .post-format-icon:before { … … 831 805 -moz-osx-font-smoothing: grayscale; 832 806 } 833 807 834 .post-state-format.post-format-standard:before, 835 .post-format-icon.post-format-standard:before, 836 a.post-state-format.format-standard:before { 808 .post-format-icon.post-format-standard:before { 837 809 content: "\f109"; 838 810 } 839 811 840 .post-state-format.post-format-image:before, 841 .post-format-icon.post-format-image:before, 842 a.post-state-format.format-image:before { 812 .post-format-icon.post-format-image:before { 843 813 content: "\f128"; 844 814 } 845 815 846 .post-state-format.post-format-gallery:before, 847 .post-format-icon.post-format-gallery:before, 848 a.post-state-format.format-gallery:before { 816 .post-format-icon.post-format-gallery:before { 849 817 content: "\f161"; 850 818 } 851 819 852 .post-state-format.post-format-audio:before, 853 .post-format-icon.post-format-audio:before, 854 a.post-state-format.format-audio:before { 820 .post-format-icon.post-format-audio:before { 855 821 content: "\f127"; 856 822 } 857 823 858 .post-state-format.post-format-video:before, 859 .post-format-icon.post-format-video:before, 860 a.post-state-format.format-video:before { 824 .post-format-icon.post-format-video:before { 861 825 content: "\f126"; 862 826 } 863 827 864 .post-state-format.post-format-chat:before, 865 .post-format-icon.post-format-chat:before, 866 a.post-state-format.format-chat:before { 828 .post-format-icon.post-format-chat:before { 867 829 content: "\f125"; 868 830 } 869 831 870 .post-state-format.post-format-status:before, 871 .post-format-icon.post-format-status:before, 872 a.post-state-format.format-status:before { 832 .post-format-icon.post-format-status:before { 873 833 content: "\f130"; 874 834 } 875 835 876 .post-state-format.post-format-aside:before, 877 .post-format-icon.post-format-aside:before, 878 a.post-state-format.format-aside:before { 836 .post-format-icon.post-format-aside:before { 879 837 content: "\f123"; 880 838 } 881 839 882 .post-state-format.post-format-quote:before, 883 .post-format-icon.post-format-quote:before, 884 a.post-state-format.format-quote:before { 840 .post-format-icon.post-format-quote:before { 885 841 content: "\f122"; 886 842 } 887 843 888 .post-state-format.post-format-link:before, 889 .post-format-icon.post-format-link:before, 890 a.post-state-format.format-link:before { 844 .post-format-icon.post-format-link:before { 891 845 content: "\f103"; 892 846 } 893 847 -
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
452 452 } 453 453 454 454 /** 455 * Display a formats dropdown for filtering items. 456 * 457 * @since 4.8.0 458 * @access protected 459 * 460 * @param string $post_type Post type key. 461 */ 462 protected function formats_dropdown( $post_type ) { 463 /** 464 * Filters whether to remove the 'Formats' drop-down from the post list table. 465 * 466 * @since 4.8.0 467 * 468 * @param bool $disable Whether to disable the drop-down. Default false. 469 */ 470 if ( apply_filters( 'disable_formats_dropdown', false ) ) { 471 return; 472 } 473 474 // Make sure the dropdown shows only formats with a post count greater than 0. 475 $used_post_formats = get_terms( array( 476 'taxonomy' => 'post_format', 477 'hide_empty' => true, 478 ) ); 479 480 /* 481 * Return if the post type doesn't have post formats, or there are no 482 * posts using formats, or if we're in the trash. 483 */ 484 if ( ! is_object_in_taxonomy( $post_type, 'post_format' ) || empty( $used_post_formats ) || $this->is_trash ) { 485 return; 486 } 487 488 $displayed_post_format = isset( $_GET['post_format'] ) ? $_GET['post_format'] : ''; 489 ?> 490 <label for="filter-by-format" class="screen-reader-text"><?php _e( 'Filter by post format' ); ?></label> 491 <select name="post_format" id="filter-by-format"> 492 <option<?php selected( $displayed_post_format, '' ); ?> value=""><?php _e( 'All formats' ); ?></option> 493 <?php 494 foreach ( $used_post_formats as $used_post_format ) { 495 // Post format slug. 496 $slug = str_replace( 'post-format-', '', $used_post_format->slug ); 497 // Pretty, translated version of the post format slug. 498 $pretty_name = get_post_format_string( $slug ); 499 // Skip the standard post format. 500 if ( 'standard' === $slug ) { 501 continue; 502 } 503 ?> 504 <option<?php selected( $displayed_post_format, $slug ) ?> value="<?php echo esc_attr( $slug ); ?>"><?php echo esc_html( $pretty_name ); ?></option> 505 <?php 506 } 507 ?> 508 </select> 509 <?php 510 } 511 512 /** 455 513 * @param string $which 456 514 */ 457 515 protected function extra_tablenav( $which ) { … … 463 521 464 522 $this->months_dropdown( $this->screen->post_type ); 465 523 $this->categories_dropdown( $this->screen->post_type ); 524 $this->formats_dropdown( $this->screen->post_type ); 466 525 467 526 /** 468 527 * Fires before the Filter button on the Posts and Pages list tables. … … 919 978 $pad = str_repeat( '— ', $this->current_level ); 920 979 echo "<strong>"; 921 980 922 $format = get_post_format( $post->ID );923 if ( $format ) {924 $label = get_post_format_string( $format );925 926 $format_class = 'post-state-format post-format-icon post-format-' . $format;927 928 $format_args = array(929 'post_format' => $format,930 'post_type' => $post->post_type931 );932 933 echo $this->get_edit_link( $format_args, $label . ':', $format_class );934 }935 936 981 $title = _draft_or_post_title(); 937 982 938 983 if ( $can_edit_post && $post->post_status != 'trash' ) {