Make WordPress Core

Ticket #16459: 16459.no-translating-slugs.2.diff

File 16459.no-translating-slugs.2.diff, 2.2 KB (added by markjaquith, 13 years ago)

With some unused code removed.

  • wp-includes/post.php

     
    50665066}
    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
    50935080/**
     
    51525139function _post_format_request( $qvs ) {
    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'] ];
    51585145        $tax = get_taxonomy( 'post_format' );
     
    51715158        global $wp_rewrite;
    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 );
    51795165                return add_query_arg( 'post_format', str_replace( 'post-format-', '', $term->slug ), $link );