跳至内容
WordPress.org

China 简体中文

  • 主题
  • 插件
  • 新闻
    • 文档
    • 论坛
  • 关于
  • 获取 WordPress
获取 WordPress
WordPress.org

Plugin Directory

DP Username & Role Display

  • 提交插件
  • 我的收藏
  • 登录
  • 提交插件
  • 我的收藏
  • 登录

DP Username & Role Display

作者:Dixit Pujara
下载
  • 详情
  • 评价
  • 安装
  • 开发进展
支持

描述

DP Username & Role Display shows the display name and role(s) of the currently logged-in user near the top of every page on the front end of your site.

It is useful for membership sites, intranets, staging environments, and any site where it helps to know, at a glance, who is logged in and what role they hold.

Features

  • Shows the logged-in user’s display name and role(s) on the front end.
  • Enable or disable the display from a settings page.
  • Choose the background, text, and label colors with the built-in WordPress color picker.
  • Edit the label text (“User:” and “Role:”) to whatever wording you prefer.
  • Pick from 5 ready-made display templates that change the front-end layout (classic bar, full-width banner, rounded pill, minimal inline, and accent card).
  • Lightweight, translation-ready, and uses only standard WordPress APIs.
  • Nothing is shown to logged-out visitors.

屏幕截图

Admin settings page: enable toggle, background/text/label color pickers, editable labels, and the display template selector.
Admin settings page: enable toggle, background/text/label color pickers, editable labels, and the display template selector.
Template 1 - Classic Bar (right aligned).
Template 1 – Classic Bar (right aligned).
Template 2 - Full-width Banner (centered).
Template 2 – Full-width Banner (centered).
Template 3 - Rounded Pill (centered).
Template 3 – Rounded Pill (centered).
Template 4 - Minimal Inline.
Template 4 – Minimal Inline.
Template 5 - Card with accent.
Template 5 – Card with accent.

安装

  1. Upload the dp-username-role-display folder to the /wp-content/plugins/ directory, or install the plugin through the Plugins > Add New screen in WordPress.
  2. Activate the plugin through the Plugins screen in WordPress.
  3. Go to Settings > User Info Settings to enable the display and choose your colors.

常见问题

Who can see the user info?

Only logged-in users see their own username and role. Logged-out visitors see nothing.

Can I change where it appears?

The info is output using the wp_body_open hook, so it appears at the top of the page body. Most modern themes support this hook.

Can I change the colors?

Yes. Go to Settings > User Info Settings and use the color pickers for the background, text, and label colors.

Can I change the “User” and “Role” wording?

Yes. The User Label and Role Label fields on the settings page let you set any text you like (for example “Logged in as” or “Account”).

What are the templates?

The plugin includes 5 display templates that change how the info looks on the front end: a classic right-aligned bar, a full-width banner, a centered rounded pill, a minimal inline style, and an accent card. Pick one from the Display Template dropdown on the settings page.

评价

此插件暂无评价。

贡献者及开发者

「DP Username & Role Display」是开源软件。 以下人员对此插件做出了贡献。

贡献者
  • Dixit Pujara

帮助将「DP Username & Role Display」翻译成简体中文。

对开发感兴趣吗?

您可以浏览代码,查看SVN仓库,或通过RSS订阅开发日志。

更新日志

1.0

  • First release in the WordPress.org plugin directory.
  • Displays the logged-in user’s name and role on the front end using the wp_body_open hook.
  • Settings page with enable/disable toggle.
  • Background, text, and label color pickers.
  • Editable “User” and “Role” label text.
  • 5 selectable front-end display templates.

额外信息

  • 版本 1.0
  • 最后更新:2 周前
  • 活跃安装数量 不到10
  • WordPress 版本 5.2 或更高版本
  • 已测试的最高版本为 7.1
  • PHP 版本 7.2 或更高版本
  • 语言
    English (US)
  • 标签
    loginmembersprofileuser roleusername
  • 高级视图

评级

尚未提交反馈。

您的评价

查看全部评论

贡献者

  • Dixit Pujara

支持

有话要说吗?是否需要帮助?

查看支持论坛

  • 关于
  • 新闻
  • 主机
  • 隐私
  • 陈列窗
  • 主题
  • 插件
  • 区块样板
  • 学习
  • 支持
  • 开发者
  • WordPress.tv ↗︎
  • 参与
  • 活动
  • 捐赠 ↗
  • 周边商品 ↗
  • WordPress.com ↗
  • Matt ↗
  • bbPress ↗
  • BuddyPress ↗
WordPress.org
WordPress.org

China 简体中文

  • 关注我们的 X(原 Twitter)账号
  • 访问我们的 Bluesky 账号
  • 关注我们的 Mastodon 账号
  • 访问我们的 Threads 账号
  • 访问我们的 Facebook 公共主页
  • 关注我们的 Instagram 账号
  • 关注我们的 LinkedIn 主页
  • 访问我们的 TikTok 账号
  • 访问我们的 YouTube 频道
  • 访问我们的 Tumblr 账号
代码如诗
The WordPress® trademark is the intellectual property of the WordPress Foundation.