mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 17:20:07 +00:00
Cast to array when using foreach(). Props santosj (and thanks for your perseverance!). fixes #2784
git-svn-id: https://develop.svn.wordpress.org/trunk@8572 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -286,7 +286,7 @@ function wp_dropdown_users( $args = '' ) {
|
||||
if ( $show_option_none )
|
||||
$output .= "\t<option value='-1'>$show_option_none</option>\n";
|
||||
|
||||
foreach ( $users as $user ) {
|
||||
foreach ( (array) $users as $user ) {
|
||||
$user->ID = (int) $user->ID;
|
||||
$_selected = $user->ID == $selected ? " selected='selected'" : '';
|
||||
$output .= "\t<option value='$user->ID'$_selected>" . wp_specialchars($user->$show) . "</option>\n";
|
||||
@@ -311,7 +311,7 @@ function _fill_user( &$user ) {
|
||||
$wpdb->show_errors($show);
|
||||
|
||||
if ( $metavalues ) {
|
||||
foreach ( $metavalues as $meta ) {
|
||||
foreach ( (array) $metavalues as $meta ) {
|
||||
$value = maybe_unserialize($meta->meta_value);
|
||||
$user->{$meta->meta_key} = $value;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user