Changeset 49036
- Timestamp:
- 09/23/2020 12:25:47 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/user.php
r49028 r49036 1192 1192 $found_selected = false; 1193 1193 $parsed_args['selected'] = (int) $parsed_args['selected']; 1194 1194 1195 foreach ( (array) $users as $user ) { 1195 1196 $user->ID = (int) $user->ID; … … 1200 1201 1201 1202 if ( ! $found_selected ) { 1202 $users[] = get_userdata( $parsed_args['selected'] ); 1203 $selected_user = get_userdata( $parsed_args['selected'] ); 1204 if ( $selected_user ) { 1205 $users[] = $selected_user; 1206 } 1203 1207 } 1204 1208 } -
trunk/tests/phpunit/tests/user/wpDropdownUsers.php
r47122 r49036 131 131 132 132 /** 133 * @ticket 51370 134 */ 135 public function test_include_selected_with_non_existing_user_id() { 136 $found = wp_dropdown_users( 137 array( 138 'echo' => false, 139 'selected' => PHP_INT_MAX, 140 'include_selected' => true, 141 'show' => 'user_login', 142 ) 143 ); 144 145 $this->assertNotContains( (string) PHP_INT_MAX, $found ); 146 } 147 148 /** 133 149 * @ticket 38135 134 150 */
Note: See TracChangeset
for help on using the changeset viewer.