Add post format icons to the radio chooser. This also trims empty margins from the sprites to make them usable in RTL and make positioning numbers more sane. props ryelle, kovshenin for the initial patch. fixes #24519.

git-svn-id: http://core.svn.wordpress.org/trunk@24429 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Helen Hou-Sandí 2013-06-07 17:15:53 +00:00
parent 42056fdae6
commit bd231c209f
10 changed files with 88 additions and 29 deletions

View File

@ -1460,7 +1460,7 @@ div.wp-menu-image {
/* Post format icons */ /* Post format icons */
a.post-state-format { .post-format-icon {
background: url(../images/post-formats-vs.png) no-repeat; background: url(../images/post-formats-vs.png) no-repeat;
} }
@ -2283,9 +2283,9 @@ h2.nav-tab-wrapper, h3.nav-tab-wrapper {
} }
/* 16px post formats */ /* 16px post formats */
a.post-state-format { .post-format-icon {
background-image: url(../images/post-formats32-vs.png); background-image: url(../images/post-formats32-vs.png);
background-size: 32px 320px; background-size: 16px 304px;
} }
} }

View File

@ -1354,7 +1354,7 @@ div.wp-menu-image {
/* Post format icons */ /* Post format icons */
a.post-state-format { .post-format-icon {
background: url(../images/post-formats.png) no-repeat; background: url(../images/post-formats.png) no-repeat;
} }
@ -2171,9 +2171,9 @@ h2.nav-tab-wrapper, h3.nav-tab-wrapper {
} }
/* 16px post formats */ /* 16px post formats */
a.post-state-format { .post-format-icon {
background-image: url(../images/post-formats32.png); background-image: url(../images/post-formats32.png);
background-size: 32px 320px; background-size: 16px 304px;
} }
} }

View File

@ -1053,6 +1053,53 @@ a.post-state-format {
margin-left: 5px; margin-left: 5px;
} }
label.post-format-icon {
margin-left: 0;
margin-right: 5px;
padding-left: 0px;
padding-right: 21px;
}
.post-format-icon.post-format-standard {
background-position: 100% 0;
}
.post-format-icon.post-format-image {
background-position: 100% -32px;
}
.post-format-icon.post-format-gallery {
background-position: 100% -64px;
}
.post-format-icon.post-format-audio {
background-position: 100% -96px;
}
.post-format-icon.post-format-video {
background-position: 100% -128px;
}
.post-format-icon.post-format-chat {
background-position: 100% -160px;
}
.post-format-icon.post-format-status {
background-position: 100% -192px;
}
.post-format-icon.post-format-aside {
background-position: 100% -224px;
}
.post-format-icon.post-format-quote {
background-position: 100% -256px;
}
.post-format-icon.post-format-link {
background-position: 100% -288px;
}
/*------------------------------------------------------------------------------ /*------------------------------------------------------------------------------
12.0 - Categories 12.0 - Categories
------------------------------------------------------------------------------*/ ------------------------------------------------------------------------------*/

View File

@ -3946,40 +3946,53 @@ a.post-state-format {
text-indent: -999em; text-indent: -999em;
} }
a.post-state-format.format-image { #post-formats-select {
background-position: -8px -40px; line-height: 2em;
} }
a.post-state-format.format-gallery { label.post-format-icon {
background-position: -8px -72px; margin-left: 5px;
padding: 2px 0 2px 21px;
} }
a.post-state-format.format-audio { .post-format-icon.post-format-standard {
background-position: -8px -104px; background-position: 0 0;
} }
a.post-state-format.format-video { .post-format-icon.post-format-image {
background-position: -8px -136px; background-position: 0 -32px;
} }
a.post-state-format.format-chat { .post-format-icon.post-format-gallery {
background-position: -8px -168px; background-position: 0 -64px;
} }
a.post-state-format.format-status { .post-format-icon.post-format-audio {
background-position: -8px -200px; background-position: 0 -96px;
} }
a.post-state-format.format-aside { .post-format-icon.post-format-video {
background-position: -8px -232px; background-position: 0 -128px;
} }
a.post-state-format.format-quote { .post-format-icon.post-format-chat {
background-position: -8px -265px; background-position: 0 -160px;
} }
a.post-state-format.format-link { .post-format-icon.post-format-status {
background-position: -8px -296px; background-position: 0 -192px;
}
.post-format-icon.post-format-aside {
background-position: 0 -224px;
}
.post-format-icon.post-format-quote {
background-position: 0 -256px;
}
.post-format-icon.post-format-link {
background-position: 0 -288px;
} }
@ -6432,8 +6445,7 @@ table.form-table td .updated {
width: 250px; width: 250px;
} }
#post-visibility-select, #post-visibility-select {
#post-formats-select {
line-height: 1.5em; line-height: 1.5em;
margin-top: 3px; margin-top: 3px;
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 KiB

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 2.2 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.2 KiB

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 8.5 KiB

After

Width:  |  Height:  |  Size: 7.6 KiB

View File

@ -551,7 +551,7 @@ class WP_Posts_List_Table extends WP_List_Table {
if ( $format = get_post_format( $post->ID ) ) { if ( $format = get_post_format( $post->ID ) ) {
$label = get_post_format_string( $format ); $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> "; echo '<a href="' . esc_url( add_query_arg( array( 'post_format' => $format, 'post_type' => $post->post_type ), 'edit.php' ) ) . '" class="post-state-format post-format-icon post-format-' . $format . '" title="' . $label . '">' . $label . ":</a> ";
} }
if ( $can_edit_post && $post->post_status != 'trash' ) { if ( $can_edit_post && $post->post_status != 'trash' ) {

View File

@ -315,9 +315,9 @@ function post_format_meta_box( $post, $box ) {
$post_formats[0][] = $post_format; $post_formats[0][] = $post_format;
?> ?>
<div id="post-formats-select"> <div id="post-formats-select">
<input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0"><?php _e('Standard'); ?></label> <input type="radio" name="post_format" class="post-format" id="post-format-0" value="0" <?php checked( $post_format, '0' ); ?> /> <label for="post-format-0" class="post-format-icon post-format-standard"><?php _e('Standard'); ?></label>
<?php foreach ( $post_formats[0] as $format ) : ?> <?php foreach ( $post_formats[0] as $format ) : ?>
<br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label> <br /><input type="radio" name="post_format" class="post-format" id="post-format-<?php echo esc_attr( $format ); ?>" value="<?php echo esc_attr( $format ); ?>" <?php checked( $post_format, $format ); ?> /> <label for="post-format-<?php echo esc_attr( $format ); ?>" class="post-format-icon post-format-<?php echo esc_attr( $format ); ?>"><?php echo esc_html( get_post_format_string( $format ) ); ?></label>
<?php endforeach; ?><br /> <?php endforeach; ?><br />
</div> </div>
<?php endif; endif; <?php endif; endif;