mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-01 07:40:07 +00:00
Lose the added column for post formats in the posts list table and add an icon before the title instead. Icons are clickable to filter the list table down to posts of that post type and format. props melchoyce for the icons. fixes #16047.
git-svn-id: https://develop.svn.wordpress.org/trunk@23765 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -2685,8 +2685,52 @@ th.asc:hover span.sorting-indicator {
|
||||
padding: 0 0 .2em 1px;
|
||||
}
|
||||
|
||||
span.post-state-format {
|
||||
font-weight: normal;
|
||||
a.post-state-format {
|
||||
overflow: hidden;
|
||||
display: inline-block;
|
||||
vertical-align: middle;
|
||||
height: 16px;
|
||||
width: 16px;
|
||||
margin-right: 5px;
|
||||
background-image: url(../images/post-formats.png);
|
||||
background-repeat: no-repeat;
|
||||
text-indent: -999em;
|
||||
}
|
||||
|
||||
a.post-state-format.format-image {
|
||||
background-position: -40px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-gallery {
|
||||
background-position: -72px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-audio {
|
||||
background-position: -104px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-video {
|
||||
background-position: -135px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-chat {
|
||||
background-position: -168px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-status {
|
||||
background-position: -200px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-aside {
|
||||
background-position: -232px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-quote {
|
||||
background-position: -264px -8px;
|
||||
}
|
||||
|
||||
a.post-state-format.format-link {
|
||||
background-position: -296px -8px;
|
||||
}
|
||||
|
||||
|
||||
@@ -9074,6 +9118,11 @@ a.widget-control-edit {
|
||||
background-size: 16px 16px;
|
||||
}
|
||||
|
||||
a.post-state-format {
|
||||
background-image: url(../images/post-formats-2x.png);
|
||||
background-size: 320px 32px;
|
||||
}
|
||||
|
||||
th .comment-grey-bubble {
|
||||
background-image: url('../images/comment-grey-bubble-2x.png');
|
||||
background-size: 12px 12px;
|
||||
|
||||
BIN
wp-admin/images/post-formats-2x.png
Normal file
BIN
wp-admin/images/post-formats-2x.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 8.1 KiB |
BIN
wp-admin/images/post-formats.png
Normal file
BIN
wp-admin/images/post-formats.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 2.3 KiB |
@@ -259,9 +259,6 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
if ( post_type_supports( $post_type, 'author' ) )
|
||||
$posts_columns['author'] = __( 'Author' );
|
||||
|
||||
if ( post_type_supports( $post_type, 'post-formats' ) )
|
||||
$posts_columns['format'] = _x( 'Format', 'post format' );
|
||||
|
||||
$taxonomies = array();
|
||||
|
||||
$taxonomies = get_object_taxonomies( $post_type, 'objects' );
|
||||
@@ -541,6 +538,13 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
|
||||
$pad = str_repeat( '— ', $level );
|
||||
echo "<td $attributes><strong>";
|
||||
|
||||
if ( $format = get_post_format( $post->ID ) ) {
|
||||
$label = get_post_format_string( $format );
|
||||
|
||||
echo '<a href="' . esc_url( add_query_arg( array( 'post_format' => $format, 'post_type' => $post->post_type ), 'edit.php' ) ) . '" class="post-state-format format-' . $format . '" title="' . $label . '">' . $label . ":</a> ";
|
||||
}
|
||||
|
||||
if ( $can_edit_post && $post->post_status != 'trash' ) {
|
||||
echo '<a class="row-title" href="' . $edit_link . '" title="' . esc_attr( sprintf( __( 'Edit “%s”' ), $title ) ) . '">' . $pad . $title . '</a>';
|
||||
} else {
|
||||
@@ -655,17 +659,6 @@ class WP_Posts_List_Table extends WP_List_Table {
|
||||
<?php
|
||||
break;
|
||||
|
||||
case 'format':
|
||||
?>
|
||||
<td <?php echo $attributes ?>><?php
|
||||
if ( get_post_format( $post->ID ) )
|
||||
printf( '<a href="%s">%s</a>', add_query_arg( array( 'post_format' => get_post_format( $post->ID ), 'post_type' => $post->post_type ), 'edit.php' ), get_post_format_string( get_post_format( $post->ID ) ) );
|
||||
else
|
||||
echo '—';
|
||||
?></td>
|
||||
<?php
|
||||
break;
|
||||
|
||||
default:
|
||||
if ( 'categories' == $column_name )
|
||||
$taxonomy = 'category';
|
||||
|
||||
Reference in New Issue
Block a user