mirror of
https://github.com/yunluo/gdk.git
synced 2024-05-10 02:06:44 +02:00
针对PHP8的优化
This commit is contained in:
parent
5c6428e0a8
commit
74bbb5d3f3
|
@ -66,7 +66,7 @@ checked($options['gdk_local_avatars_caps'], 1); ?>/>仅具有头像上传权限
|
||||||
return $new_input;
|
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)) {
|
if (is_numeric($id_or_email)) {
|
||||||
$user_id = (int) $id_or_email;
|
$user_id = (int) $id_or_email;
|
||||||
|
|
|
@ -184,7 +184,7 @@ class GDK_Points_Admin
|
||||||
public static function admin_notices()
|
public static function admin_notices()
|
||||||
{
|
{
|
||||||
if (!empty(self::$notices)) {
|
if (!empty(self::$notices)) {
|
||||||
foreach (self::$notices as $notice) {
|
foreach ((array) self::$notices as $notice) {
|
||||||
echo $notice;
|
echo $notice;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -225,7 +225,7 @@ class GDK_Points_Admin
|
||||||
$k[] = '<div style="margin-bottom:10px;">用户ID:'.$sdata.' || 总金币为:'.GDK_Points::get_user_total_points($sdata).'</div>';
|
$k[] = '<div style="margin-bottom:10px;">用户ID:'.$sdata.' || 总金币为:'.GDK_Points::get_user_total_points($sdata).'</div>';
|
||||||
}
|
}
|
||||||
if (is_array($points)) {
|
if (is_array($points)) {
|
||||||
foreach ($points as $point) {
|
foreach ((array) $points as $point) {
|
||||||
$userid = $point->user_id;
|
$userid = $point->user_id;
|
||||||
$user_name = get_user_by('id', $userid)->display_name;
|
$user_name = get_user_by('id', $userid)->display_name;
|
||||||
$k[] = '<div style="margin-bottom:5px;">用户ID:'.$userid.' || 金币:'.$point->points.' || 描述:'.$point->description.' || 日期:'.$point->datetime.' || 用户名:'.$user_name.'</div>';
|
$k[] = '<div style="margin-bottom:5px;">用户ID:'.$userid.' || 金币:'.$point->points.' || 描述:'.$point->description.' || 日期:'.$point->datetime.' || 用户名:'.$user_name.'</div>';
|
||||||
|
@ -457,7 +457,7 @@ class GDK_Points_Admin
|
||||||
$output .= '<span class="title">状态</span>';
|
$output .= '<span class="title">状态</span>';
|
||||||
$output .= ' ';
|
$output .= ' ';
|
||||||
$output .= '<select name="status">';
|
$output .= '<select name="status">';
|
||||||
foreach ($status_descriptions as $key => $label) {
|
foreach ((array) $status_descriptions as $key => $label) {
|
||||||
$selected = $key == $status ? ' selected="selected" ' : '';
|
$selected = $key == $status ? ' selected="selected" ' : '';
|
||||||
$output .= '<option '.$selected.' value="'.esc_attr($key).'">'.$label.'</option>';
|
$output .= '<option '.$selected.' value="'.esc_attr($key).'">'.$label.'</option>';
|
||||||
}
|
}
|
||||||
|
|
|
@ -88,7 +88,7 @@ if (!class_exists('ThemeUpdateChecker')) {
|
||||||
return $theme->get('Version');
|
return $theme->get('Version');
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach (get_themes() as $theme) {
|
foreach ((array) get_themes() as $theme) {
|
||||||
if ($theme['Stylesheet'] === $this->theme) {
|
if ($theme['Stylesheet'] === $this->theme) {
|
||||||
return $theme['Version'];
|
return $theme['Version'];
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ if (!class_exists('ThemeUpdate')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$update = new self();
|
$update = new self();
|
||||||
foreach (get_object_vars($apiResponse) as $key => $value) {
|
foreach ((array) get_object_vars($apiResponse) as $key => $value) {
|
||||||
$update->{$key} = $value;
|
$update->{$key} = $value;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue