Make WordPress Core


Ignore:
Timestamp:
07/02/2014 12:10:13 AM (10 years ago)
Author:
SergeyBiryukov
Message:

Simplify a condition in get_sample_permalink_html().

see #28350.

File:
1 edited

Legend:

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

    r28947 r28948  
    11991199        }
    12001200    } else {
    1201         if ( function_exists( 'mb_strlen' ) ) {
    1202             if ( mb_strlen( $post_name ) > 30 ) {
    1203                 $post_name_abridged = mb_substr( $post_name, 0, 14 ) . '…' . mb_substr( $post_name, -14 );
    1204             } else {
    1205                 $post_name_abridged = $post_name;
    1206             }
     1201        if ( function_exists( 'mb_strlen' ) && mb_strlen( $post_name ) > 30 ) {
     1202            $post_name_abridged = mb_substr( $post_name, 0, 14 ) . '…' . mb_substr( $post_name, -14 );
     1203        } elseif ( strlen( $post_name ) > 30 ) {
     1204            $post_name_abridged = substr( $post_name, 0, 14 ) . '…' . substr( $post_name, -14 );
    12071205        } else {
    1208             if ( strlen( $post_name ) > 30 ) {
    1209                 $post_name_abridged = substr( $post_name, 0, 14 ) . '…' . substr( $post_name, -14 );
    1210             } else {
    1211                 $post_name_abridged = $post_name;
    1212             }
     1206            $post_name_abridged = $post_name;
    12131207        }
    12141208
Note: See TracChangeset for help on using the changeset viewer.