Changeset 60269
- Timestamp:
- 05/30/2025 05:00:17 PM (7 weeks ago)
- Location:
- trunk/src
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/options-discussion.php
r59600 r60269 310 310 'retro' => __( 'Retro (Generated)' ), 311 311 'robohash' => __( 'RoboHash (Generated)' ), 312 'initials' => __( 'Initials (Generated)' ), 313 'color' => __( 'Color (Generated)' ), 312 314 ); 313 315 /** -
trunk/src/wp-includes/link-template.php
r60152 r60269 4299 4299 * - 'wavatar' (a cartoon face) 4300 4300 * - 'identicon' (the "quilt", a geometric pattern) 4301 * - 'initials' (initials based avatar with background color) 4302 * - 'color' (generated background color) 4301 4303 * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) 4302 4304 * - 'blank' (transparent GIF) … … 4367 4369 * - 'wavatar' (a cartoon face) 4368 4370 * - 'identicon' (the "quilt", a geometric pattern) 4371 * - 'initials' (initials based avatar with background color) 4372 * - 'color' (generated background color) 4369 4373 * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) 4370 4374 * - 'blank' (transparent GIF) … … 4546 4550 ); 4547 4551 4552 // Handle additional parameters for the 'initials' avatar type 4553 if ( 'initials' === $args['default'] ) { 4554 $name = ''; 4555 4556 if ( $user ) { 4557 $name = ! empty( $user->display_name ) ? $user->display_name : 4558 ( ! empty( $user->first_name ) && ! empty( $user->last_name ) ? 4559 $user->first_name . ' ' . $user->last_name : $user->user_login ); 4560 } elseif ( is_object( $id_or_email ) && isset( $id_or_email->comment_author ) ) { 4561 $name = $id_or_email->comment_author; 4562 } elseif ( is_string( $id_or_email ) && false !== strpos( $id_or_email, '@' ) ) { 4563 $name = str_replace( array( '.', '_', '-' ), ' ', substr( $id_or_email, 0, strpos( $id_or_email, '@' ) ) ); 4564 } 4565 4566 if ( ! empty( $name ) ) { 4567 if ( preg_match( '/\p{Han}|\p{Hiragana}|\p{Katakana}|\p{Hangul}/u', $name ) || false === strpos( $name, ' ' ) ) { 4568 $initials = mb_substr( $name, 0, min( 2, mb_strlen( $name, 'UTF-8' ) ), 'UTF-8' ); 4569 } else { 4570 $first = mb_substr( $name, 0, 1, 'UTF-8' ); 4571 $last = mb_substr( $name, strrpos( $name, ' ' ) + 1, 1, 'UTF-8' ); 4572 $initials = $first . $last; 4573 } 4574 4575 $url_args['initials'] = $initials; 4576 } 4577 } 4578 4548 4579 /* 4549 4580 * Gravatars are always served over HTTPS. -
trunk/src/wp-includes/pluggable.php
r59893 r60269 3049 3049 * - 'wavatar' (a cartoon face) 3050 3050 * - 'identicon' (the "quilt", a geometric pattern) 3051 * - 'initials' (initials based avatar with background color) 3052 * - 'color' (generated background color) 3051 3053 * - 'mystery', 'mm', or 'mysteryman' (The Oyster Man) 3052 3054 * - 'blank' (transparent GIF)
Note: See TracChangeset
for help on using the changeset viewer.