Make WordPress Core

Changeset 17391


Ignore:
Timestamp:
02/05/2011 06:24:01 PM (14 years ago)
Author:
markjaquith
Message:

No translation for post format slugs. Too fragile for the future. fixes #16459 for trunk

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r17298 r17391  
    50675067
    50685068/**
    5069  * Retrieves an array of (translated and sanitized) post format slugs.
     5069 * Retrieves an array of post format slugs.
    50705070 *
    50715071 * @since 3.1.0
    50725072 *
    5073  * @uses sanitize_title_with_dashes()
    5074  * @return array The array of (translated and sanitized) post format slugs.
     5073 * @return array The array of post format slugs.
    50755074 */
    50765075function get_post_format_slugs() {
    5077     $slugs = array(
    5078         'standard' => _x( 'standard', 'Post format slug' ),
    5079         'aside'    => _x( 'aside',    'Post format slug' ),
    5080         'chat'     => _x( 'chat',     'Post format slug' ),
    5081         'gallery'  => _x( 'gallery',  'Post format slug' ),
    5082         'link'     => _x( 'link',     'Post format slug' ),
    5083         'image'    => _x( 'image',    'Post format slug' ),
    5084         'quote'    => _x( 'quote',    'Post format slug' ),
    5085         'status'   => _x( 'status',   'Post format slug' ),
    5086         'video'    => _x( 'video',    'Post format slug' ),
    5087         'audio'    => _x( 'audio',    'Post format slug' ),
    5088     );
    5089     $slugs = array_map( 'sanitize_title_with_dashes', $slugs );
    5090     return $slugs;
     5076    $slugs = array_keys( get_post_format_strings() );
     5077    return array_combine( $slugs, $slugs );
    50915078}
    50925079
     
    51535140    if ( ! isset( $qvs['post_format'] ) )
    51545141        return $qvs;
    5155     $slugs = array_flip( get_post_format_slugs() );
     5142    $slugs = get_post_format_slugs();
    51565143    if ( isset( $slugs[ $qvs['post_format'] ] ) )
    51575144        $qvs['post_format'] = 'post-format-' . $slugs[ $qvs['post_format'] ];
     
    51725159    if ( 'post_format' != $taxonomy )
    51735160        return $link;
    5174     $slugs = get_post_format_slugs();
    51755161    if ( $wp_rewrite->get_extra_permastruct( $taxonomy ) ) {
    5176         return str_replace( "/{$term->slug}", '/' . $slugs[ str_replace( 'post-format-', '', $term->slug ) ], $link );
     5162        return str_replace( "/{$term->slug}", '/' . str_replace( 'post-format-', '', $term->slug ), $link );
    51775163    } else {
    51785164        $link = remove_query_arg( 'post_format', $link );
Note: See TracChangeset for help on using the changeset viewer.