针对PHP8的优化

This commit is contained in:
云落 2021-10-21 18:43:29 +08:00
parent 5c6428e0a8
commit 74bbb5d3f3
3 changed files with 6 additions and 6 deletions

View File

@ -66,7 +66,7 @@ checked($options['gdk_local_avatars_caps'], 1); ?>/>仅具有头像上传权限
return $new_input;
}
public function get_avatar($avatar, $id_or_email, $size = 96, $default, $alt)
public function get_avatar($avatar, $id_or_email, $size, $default, $alt)
{
if (is_numeric($id_or_email)) {
$user_id = (int) $id_or_email;

View File

@ -184,7 +184,7 @@ class GDK_Points_Admin
public static function admin_notices()
{
if (!empty(self::$notices)) {
foreach (self::$notices as $notice) {
foreach ((array) self::$notices as $notice) {
echo $notice;
}
}
@ -225,7 +225,7 @@ class GDK_Points_Admin
$k[] = '<div style="margin-bottom:10px;">用户ID'.$sdata.' &nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;总金币为:'.GDK_Points::get_user_total_points($sdata).'</div>';
}
if (is_array($points)) {
foreach ($points as $point) {
foreach ((array) $points as $point) {
$userid = $point->user_id;
$user_name = get_user_by('id', $userid)->display_name;
$k[] = '<div style="margin-bottom:5px;">用户ID'.$userid.'&nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;金币:'.$point->points.' &nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;描述:'.$point->description.' &nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;日期:'.$point->datetime.'&nbsp;&nbsp;&nbsp;||&nbsp;&nbsp;&nbsp;用户名:'.$user_name.'</div>';
@ -457,7 +457,7 @@ class GDK_Points_Admin
$output .= '<span class="title">状态</span>';
$output .= ' ';
$output .= '<select name="status">';
foreach ($status_descriptions as $key => $label) {
foreach ((array) $status_descriptions as $key => $label) {
$selected = $key == $status ? ' selected="selected" ' : '';
$output .= '<option '.$selected.' value="'.esc_attr($key).'">'.$label.'</option>';
}

View File

@ -88,7 +88,7 @@ if (!class_exists('ThemeUpdateChecker')) {
return $theme->get('Version');
}
foreach (get_themes() as $theme) {
foreach ((array) get_themes() as $theme) {
if ($theme['Stylesheet'] === $this->theme) {
return $theme['Version'];
}
@ -180,7 +180,7 @@ if (!class_exists('ThemeUpdate')) {
}
$update = new self();
foreach (get_object_vars($apiResponse) as $key => $value) {
foreach ((array) get_object_vars($apiResponse) as $key => $value) {
$update->{$key} = $value;
}