WordPress.org

Making WordPress.org

Ticket #2628: 2628.patch

File 2628.patch, 1.1 KB (added by SergeyBiryukov, 16 months ago)
  • sites/trunk/wordpress.org/public_html/wp-content/themes/pub/wporg-plugins/functions.php

     
    154154 */
    155155function excerpt_length( $excerpt ) {
    156156        if ( is_home() || is_archive() ) {
    157                 $excerpt = wp_trim_words( $excerpt, 15 );
     157                /*
     158                 * translators: If your word count is based on single characters (e.g. East Asian characters),
     159                 * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.
     160                 * Do not translate into your own language.
     161                 */
     162                if ( strpos( _x( 'words', 'Word count type. Do not translate!', 'wporg-plugins' ), 'characters' ) === 0 ) {
     163                        // Use the default limit of 55 characters for East Asian locales.
     164                        $excerpt = wp_trim_words( $excerpt );
     165                } else {
     166                        // Limit the excerpt to 15 words for other locales.
     167                        $excerpt = wp_trim_words( $excerpt, 15 );
     168                }
    158169        }
    159170
    160171        return $excerpt;