优化了一些问题
This commit is contained in:
1 parent
1d904e6532
commit
780e1eba21
46 files changed
+4074
-3143
No files matched your search
@@ -16,32 +16,35 @@ $binding_name_map = [
|
||||
'gitee' => 'Gitee',
|
||||
'qq' => 'QQ',
|
||||
'google' => 'Google',
|
||||
'weibo' => '微博',
|
||||
'weixin' => '微信',
|
||||
'weixingzh' => '微信公众号',
|
||||
];
|
||||
$binding_rows = [];
|
||||
foreach ((array) ($oauth_data['bindings'] ?? []) as $binding) {
|
||||
$key = $binding['key'] ?? '';
|
||||
$key = sanitize_key((string) ($binding['provider'] ?? $binding['key'] ?? $binding['name'] ?? ''));
|
||||
if (!$key) {
|
||||
continue;
|
||||
}
|
||||
$binding_rows[$key] = [
|
||||
'key' => $key,
|
||||
'name' => $binding_name_map[$key] ?? ($binding['name'] ?? ucfirst($key)),
|
||||
'name' => (string) ($binding['label'] ?? $binding_name_map[$key] ?? $binding['name'] ?? ucfirst($key)),
|
||||
'icon' => $binding['icon'] ?? '',
|
||||
'is_bound' => true,
|
||||
'url' => '',
|
||||
];
|
||||
}
|
||||
foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
|
||||
$key = $binding['key'] ?? '';
|
||||
$key = sanitize_key((string) ($binding['provider'] ?? $binding['key'] ?? $binding['name'] ?? ''));
|
||||
if (!$key) {
|
||||
continue;
|
||||
}
|
||||
$binding_rows[$key] = [
|
||||
'key' => $key,
|
||||
'name' => $binding_name_map[$key] ?? ($binding['name'] ?? ucfirst($key)),
|
||||
'name' => (string) ($binding['label'] ?? $binding_name_map[$key] ?? $binding['name'] ?? ucfirst($key)),
|
||||
'icon' => $binding['icon'] ?? '',
|
||||
'is_bound' => false,
|
||||
'url' => $binding['url'] ?? '',
|
||||
'url' => $binding['start_url'] ?? $binding['url'] ?? '',
|
||||
];
|
||||
}
|
||||
?>
|
||||
@@ -70,7 +73,7 @@ foreach ((array) ($oauth_data['available'] ?? []) as $binding) {
|
||||
</button>
|
||||
</div>
|
||||
<?php else : ?>
|
||||
<a href="<?php echo esc_url($binding['url']); ?>" class="binding-item binding-item--linkable" target="_self">
|
||||
<a href="<?php echo esc_url($binding['url']); ?>" class="binding-item binding-item--linkable" target="_self" data-provider="<?php echo esc_attr($binding['key']); ?>">
|
||||
<span class="binding-item__icon"><?php echo $binding['icon']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?></span>
|
||||
<span class="binding-item__meta">
|
||||
<span class="binding-status binding-status--idle"><?php esc_html_e('未绑定', 'aksrt'); ?></span>
|
||||
|
||||
Reference in new issue
Block a user