35 lines
1.5 KiB
PHP
35 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* User center profile form: contact rows block.
|
|
*
|
|
* Expects extracted $context vars.
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
if (empty($user_center_settings['social_links'])) {
|
|
return;
|
|
}
|
|
?>
|
|
<div class="widget-card">
|
|
<h3 class="widget-title"><?php esc_html_e('联系方式', 'aksrt'); ?></h3>
|
|
<p class="profile-hint profile-hint--top"><?php esc_html_e('添加你的社交链接,显示在公开用户主页', 'aksrt'); ?></p>
|
|
<div id="contacts-list">
|
|
<?php foreach ((array) $user_contacts as $i => $contact) : ?>
|
|
<div class="contact-row" data-index="<?php echo (int) $i; ?>">
|
|
<select name="contacts[<?php echo (int) $i; ?>][icon]" class="profile-input contact-icon">
|
|
<?php echo aksrt_contact_icon_options($contact['icon'] ?? ''); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped ?>
|
|
</select>
|
|
<input type="hidden" name="contacts[<?php echo (int) $i; ?>][name]" value="">
|
|
<input type="url" name="contacts[<?php echo (int) $i; ?>][url]"
|
|
value="<?php echo esc_url($contact['url'] ?? ''); ?>"
|
|
class="profile-input contact-url" placeholder="<?php esc_attr_e('链接 URL', 'aksrt'); ?>">
|
|
<button type="button" class="contact-remove" onclick="this.parentElement.remove()" title="<?php esc_attr_e('删除', 'aksrt'); ?>">×</button>
|
|
</div>
|
|
<?php endforeach; ?>
|
|
</div>
|
|
<button type="button" class="btn-ghost btn-sm profile-add-contact" id="add-contact-btn">+ <?php esc_html_e('添加联系方式', 'aksrt'); ?></button>
|
|
</div>
|