文章摘要
The article explains how to display a user's UID on both the user center and user profile pages in the "zibll" WordPress theme. In the user center (page.php), it modifies lines 49 and 50 to include the UID, username, and email with copy functionality through buttons. For the user profile page (zib-author.php), it updates line 38 to show the UID alongside the user's identity, also using copy buttons. The changes involve adding HTML and data attributes tied to each user's unique ID and other details.
— 文章部分摘要由DeepSeek深度思考而成
用户中心:/wp-content/themes/zibll/inc/functions/user/page.php
替换原:49 和 50 行
$desc = '<span class="but c-theme" data-toggle="tooltip" title="" data-clipboard-tag="UID" data-clipboard-text="' . $user_id . '" data-original-title="点击复制UID"><i class="fa fa-id-card-o"></i>UID:' . $user_id . '</span><span class="but c-blue" data-toggle="tooltip" title="" data-clipboard-tag="用户名" data-clipboard-text="' . $user->user_login . '" data-original-title="点击复制用户名"><i class="fa fa-user-o"></i>' . $user->user_login . '</span>';
$desc .= $user->user_email ? '<span class="but c-yellow" data-toggle="tooltip" title="" data-clipboard-tag="邮箱" data-clipboard-text="' . $user->user_email . '" data-original-title="点击复制邮箱"><i class="fa fa-envelope-o"></i>' . $user->user_email . '</span>' : '';
用户主页:/wp-content/themes/zibll/inc/functions/zib-author.php
替换原:38 行
$info_html .= '<div class="user-identity flex ac hh"><span class="but c-theme" data-toggle="tooltip" title=""data-clipboard-tag="UID"data-clipboard-text="' . $author_id . '"data-original-title=" 点击复制 UID"><i class="fa fa-id-card-o"></i>UID:' . $author_id . '</span>' . ($identity ? ' ' . $identity : '') . '</div>';
![图片[1]|子比主题用户中心和用户主页显示UID|不死鸟资源网](https://busi.net/wp-content/uploads/2025/06/20250615072107992-image-1024x658.png)
本站资源均为作者提供和网友推荐收集整理而来,仅供学习和研究使用,请在下载后24小时内删除,谢谢合作!
THE END