43 lines
1.7 KiB
PHP
43 lines
1.7 KiB
PHP
<?php
|
|
/**
|
|
* User center profile form part (orchestrator).
|
|
*
|
|
* @package AKSRT
|
|
*/
|
|
|
|
defined('ABSPATH') || exit;
|
|
|
|
$context = is_array($args['context'] ?? null) ? $args['context'] : [];
|
|
extract($context, EXTR_SKIP); // phpcs:ignore WordPress.PHP.DontExtract.extract_extract
|
|
?>
|
|
<form class="profile-form" id="profile-form" method="post">
|
|
<?php wp_nonce_field('aksrt_profile_save', '_profile_nonce'); ?>
|
|
<input type="hidden" name="action" value="aksrt_save_profile">
|
|
<input type="hidden" name="user_id" value="<?php echo (int) $user_id; ?>">
|
|
|
|
<div class="widget-card">
|
|
<h3 class="widget-title"><?php esc_html_e('昵称', 'aksrt'); ?></h3>
|
|
<input type="text" name="nickname" id="profile-nickname"
|
|
value="<?php echo esc_attr($target_user->display_name); ?>"
|
|
class="profile-input" maxlength="50" required>
|
|
<p class="profile-hint"><?php esc_html_e('修改后会同步更新个人主页地址', 'aksrt'); ?></p>
|
|
</div>
|
|
|
|
<div class="widget-card">
|
|
<h3 class="widget-title"><?php esc_html_e('个人简介', 'aksrt'); ?></h3>
|
|
<textarea name="description" id="profile-bio" class="profile-input profile-textarea"
|
|
rows="4" maxlength="500" placeholder="<?php esc_attr_e('介绍一下自己…', 'aksrt'); ?>"><?php echo esc_textarea($target_user->description); ?></textarea>
|
|
<p class="profile-hint"><?php esc_html_e('显示在你的公开用户主页上,最多 500 字', 'aksrt'); ?></p>
|
|
</div>
|
|
|
|
<?php require __DIR__ . '/form-contacts.php'; ?>
|
|
|
|
|
|
<div class="profile-form__submit">
|
|
<button type="submit" class="btn-primary btn-lg" id="profile-save-btn">
|
|
<?php esc_html_e('保存修改', 'aksrt'); ?>
|
|
</button>
|
|
<span id="profile-save-msg" class="profile-form__submit-msg"></span>
|
|
</div>
|
|
</form>
|