Permalinks: Slightly lengthen the truncated slug for display.

This brings it closer to the width of the input so there is less jumping around of buttons. We can afford the space now that other buttons in the space are typically no longer there.

fixes #18306.


git-svn-id: https://develop.svn.wordpress.org/trunk@34833 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Helen Hou-Sandi 2015-10-05 19:28:19 +00:00
parent 3e29193b98
commit 3cde6d29c7

View File

@ -1327,14 +1327,14 @@ function get_sample_permalink_html( $id, $new_title = null, $new_slug = null ) {
}
} else {
if ( function_exists( 'mb_strlen' ) ) {
if ( mb_strlen( $post_name ) > 30 ) {
$post_name_abridged = mb_substr( $post_name, 0, 14 ) . '…' . mb_substr( $post_name, -14 );
if ( mb_strlen( $post_name ) > 34 ) {
$post_name_abridged = mb_substr( $post_name, 0, 16 ) . '…' . mb_substr( $post_name, -16 );
} else {
$post_name_abridged = $post_name;
}
} else {
if ( strlen( $post_name ) > 30 ) {
$post_name_abridged = substr( $post_name, 0, 14 ) . '…' . substr( $post_name, -14 );
if ( strlen( $post_name ) > 34 ) {
$post_name_abridged = substr( $post_name, 0, 16 ) . '…' . substr( $post_name, -16 );
} else {
$post_name_abridged = $post_name;
}