Changeset 16191
- Timestamp:
- 11/04/2010 06:33:50 PM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/wp-admin/includes/meta-boxes.php
r16188 r16191 159 159 $post_formats = get_theme_support( 'post-formats' ); 160 160 161 $post_formats_display = get_post_format_strings(); 162 161 163 if ( is_array( $post_formats[0] ) ) : 162 164 $post_format = get_post_format( $post->ID ); 163 165 if ( !$post_format ) 164 166 $post_format = '0'; 165 $post_format_display = ( $post_format ) ? $post_format : __('Default');167 $post_format_display = $post_formats_display[$post_format]; 166 168 ?> 167 169 <div class="misc-pub-section" id="post-formats"><label for="post-format"><?php _e( 'Format:' ); ?></label> … … 174 176 <option value="0" <?php selected( $post_format, '0' ); ?>><?php _e('Default'); ?></option> 175 177 <?php foreach ( $post_formats[0] as $format ) : ?> 176 <option value="<?php echo esc_attr( $format ); ?>" <?php selected( $post_format, $format ); ?>><?php echo esc_html( $ format); ?></option>178 <option value="<?php echo esc_attr( $format ); ?>" <?php selected( $post_format, $format ); ?>><?php echo esc_html( $post_formats_display[$format] ); ?></option> 177 179 <?php endforeach; ?> 178 180 </select> -
trunk/wp-includes/post.php
r16121 r16191 5213 5213 } 5214 5214 5215 /** 5216 * Returns an array of post format slugs to their translated and pretty display versions 5217 * 5218 * @return array The array of translations 5219 */ 5220 function get_post_format_strings() { 5221 $strings = array( 5222 '0' => _x( 'Default', 'Post format' ), 5223 'aside' => _x( 'Aside', 'Post format' ), 5224 'chat' => _x( 'Chat', 'Post format' ), 5225 'gallery' => _x( 'Gallery', 'Post format' ), 5226 'link' => _x( 'Link', 'Post format' ), 5227 'image' => _x( 'Image', 'Post format' ), 5228 'quote' => _x( 'Quote', 'Post format' ), 5229 'status' => _x( 'Status', 'Post format' ), 5230 'video' => _x( 'Video', 'Post format' ) 5231 ); 5232 return apply_filters( 'post_format_strings', $strings ); 5233 } 5234 5215 5235 ?>
Note: See TracChangeset
for help on using the changeset viewer.