{"id":329071,"date":"2026-08-27T11:16:48","date_gmt":"2026-08-27T11:16:48","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/display-username-role\/"},"modified":"2026-09-07T15:02:08","modified_gmt":"2026-09-07T15:02:08","slug":"dp-username-role-display","status":"publish","type":"plugin","link":"https:\/\/kk.wordpress.org\/plugins\/dp-username-role-display\/","author":15925867,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.1","stable_tag":"1.1","tested":"7.1.1","requires":"5.2","requires_php":"7.2","requires_plugins":null,"header_name":"DP Username & Role Display","header_author":"Dixit Pujara","header_description":"Displays the username and role of the logged-in user at the top of the site, with customizable colors, editable labels, and 5 display templates.","assets_banners_color":"163166","last_updated":"2026-09-07 15:02:08","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/wordpress.org\/plugins\/dp-username-role-display\/","header_author_uri":"https:\/\/profiles.wordpress.org\/dixitpujara\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":145,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0":{"tag":"1.0","author":"dixitpujara","date":"2026-08-27 11:16:29","revision":3668667},"1.1":{"tag":"1.1","author":"dixitpujara","date":"2026-09-07 15:02:08","revision":3685149}},"upgrade_notice":{"1.1":"<p>New: profile icon (avatar) option and a [dp_user_role_display] shortcode with a live generator on the settings page.<\/p>","1.0":"<p>First release of DP Username &amp; Role Display in the WordPress.org directory.<\/p>"},"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3668845,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3668845,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3668845,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3668845,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0","1.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3668790,"resolution":"1","location":"assets","locale":"","width":1047,"height":653},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3668667,"resolution":"2","location":"assets","locale":"","width":1000,"height":360},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3668667,"resolution":"3","location":"assets","locale":"","width":1000,"height":360},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3668667,"resolution":"4","location":"assets","locale":"","width":1000,"height":360},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3668667,"resolution":"5","location":"assets","locale":"","width":1000,"height":360},"screenshot-6.png":{"filename":"screenshot-6.png","revision":3668667,"resolution":"6","location":"assets","locale":"","width":1000,"height":360}},"screenshots":{"1":"Admin settings page: enable toggle, background\/text\/label color pickers, editable labels, and the display template selector.","2":"Template 1 - Classic Bar (right aligned).","3":"Template 2 - Full-width Banner (centered).","4":"Template 3 - Rounded Pill (centered).","5":"Template 4 - Minimal Inline.","6":"Template 5 - Card with accent."}},"plugin_section":[],"plugin_tags":[602,1919,435,1925,3995],"plugin_category":[38,43,58],"plugin_contributors":[274157],"plugin_business_model":[],"class_list":["post-329071","plugin","type-plugin","status-publish","hentry","plugin_tags-login","plugin_tags-members","plugin_tags-profile","plugin_tags-user-role","plugin_tags-username","plugin_category-authentication","plugin_category-customization","plugin_category-user-management","plugin_contributors-dixitpujara","plugin_committers-dixitpujara"],"banners":{"banner":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/banner-772x250.png?rev=3668845","banner_2x":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/banner-1544x500.png?rev=3668845","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/icon-128x128.png?rev=3668845","icon_2x":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/icon-256x256.png?rev=3668845","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/screenshot-1.png?rev=3668790","caption":"Admin settings page: enable toggle, background\/text\/label color pickers, editable labels, and the display template selector."},{"src":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/screenshot-2.png?rev=3668667","caption":"Template 1 - Classic Bar (right aligned)."},{"src":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/screenshot-3.png?rev=3668667","caption":"Template 2 - Full-width Banner (centered)."},{"src":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/screenshot-4.png?rev=3668667","caption":"Template 3 - Rounded Pill (centered)."},{"src":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/screenshot-5.png?rev=3668667","caption":"Template 4 - Minimal Inline."},{"src":"https:\/\/ps.w.org\/dp-username-role-display\/assets\/screenshot-6.png?rev=3668667","caption":"Template 5 - Card with accent."}],"raw_content":"<!--section=description-->\n<p>DP Username &amp; 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.<\/p>\n\n<p>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.<\/p>\n\n<p><strong>Features<\/strong><\/p>\n\n<ul>\n<li>Shows the logged-in user's display name and role(s) on the front end.<\/li>\n<li>Enable or disable the display from a settings page.<\/li>\n<li>Choose the background, text, and label colors with the built-in WordPress color picker.<\/li>\n<li>Edit the label text (\"User:\" and \"Role:\") to whatever wording you prefer.<\/li>\n<li>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).<\/li>\n<li>Optionally show the user's profile icon (avatar) next to their name, with an adjustable size.<\/li>\n<li>Place the block anywhere with the <code>[dp_user_role_display]<\/code> shortcode - every setting can be overridden per shortcode.<\/li>\n<li>Built-in shortcode generator on the settings page: it updates live as you change options, ready to copy and paste.<\/li>\n<li>Lightweight, translation-ready, and uses only standard WordPress APIs.<\/li>\n<li>Ships with translations for Spanish, French, German, Hindi, and Gujarati.<\/li>\n<li>Nothing is shown to logged-out visitors.<\/li>\n<\/ul>\n\n<!--section=installation-->\n<ol>\n<li>Upload the <code>dp-username-role-display<\/code> folder to the <code>\/wp-content\/plugins\/<\/code> directory, or install the plugin through the <strong>Plugins &gt; Add New<\/strong> screen in WordPress.<\/li>\n<li>Activate the plugin through the <strong>Plugins<\/strong> screen in WordPress.<\/li>\n<li>Go to <strong>Settings &gt; User Info Settings<\/strong> to enable the display and choose your colors.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"who%20can%20see%20the%20user%20info%3F\"><h3>Who can see the user info?<\/h3><\/dt>\n<dd><p>Only logged-in users see their own username and role. Logged-out visitors see nothing.<\/p><\/dd>\n<dt id=\"can%20i%20change%20where%20it%20appears%3F\"><h3>Can I change where it appears?<\/h3><\/dt>\n<dd><p>The info is output using the <code>wp_body_open<\/code> hook, so it appears at the top of the page body. Most modern themes support this hook.<\/p><\/dd>\n<dt id=\"can%20i%20change%20the%20colors%3F\"><h3>Can I change the colors?<\/h3><\/dt>\n<dd><p>Yes. Go to <strong>Settings &gt; User Info Settings<\/strong> and use the color pickers for the background, text, and label colors.<\/p><\/dd>\n<dt id=\"can%20i%20change%20the%20%22user%22%20and%20%22role%22%20wording%3F\"><h3>Can I change the \"User\" and \"Role\" wording?<\/h3><\/dt>\n<dd><p>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\").<\/p><\/dd>\n<dt id=\"what%20are%20the%20templates%3F\"><h3>What are the templates?<\/h3><\/dt>\n<dd><p>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.<\/p><\/dd>\n<dt id=\"how%20do%20i%20show%20the%20profile%20icon%3F\"><h3>How do I show the profile icon?<\/h3><\/dt>\n<dd><p>Enable <strong>Show Profile Icon<\/strong> on the settings page and set the size (16-128 pixels). The plugin uses the standard WordPress avatar (<code>get_avatar()<\/code>), so it shows the same profile picture as elsewhere on your site.<\/p><\/dd>\n<dt id=\"how%20do%20i%20use%20the%20shortcode%3F\"><h3>How do I use the shortcode?<\/h3><\/dt>\n<dd><p>Add <code>[dp_user_role_display]<\/code> to any post, page, or widget. With no attributes it follows your saved settings. You can override any of them per shortcode:<\/p>\n\n<pre><code>[dp_user_role_display template=\"3\" avatar=\"yes\" avatar_size=\"48\" bg_color=\"#0d1b2a\" text_color=\"#ffffff\" label_color=\"#ffd60a\" user_label=\"Logged in as\" role_label=\"Access level\"]\n<\/code><\/pre>\n\n<p>Available attributes: <code>template<\/code> (1-5), <code>bg_color<\/code>, <code>text_color<\/code>, <code>label_color<\/code> (hex colors), <code>user_label<\/code>, <code>role_label<\/code> (text), <code>avatar<\/code> (yes\/no), <code>avatar_size<\/code> (16-128). The settings page also generates the shortcode for you as you change options.<\/p><\/dd>\n<dt id=\"does%20the%20shortcode%20work%20when%20enable%20display%20is%20off%3F\"><h3>Does the shortcode work when Enable Display is off?<\/h3><\/dt>\n<dd><p>Yes. The Enable Display toggle only controls the automatic block at the top of the page. The shortcode always renders for logged-in users, so you can turn off the automatic display and place the info exactly where you want it.<\/p><\/dd>\n<dt id=\"is%20the%20plugin%20translated%3F\"><h3>Is the plugin translated?<\/h3><\/dt>\n<dd><p>Yes. Spanish, French, German, Hindi, and Gujarati translations are bundled, and the plugin picks the right one automatically based on your site language. Every string is translation-ready, so any other language can be added via the included <code>.pot<\/code> template or translate.wordpress.org.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.1<\/h4>\n\n<ul>\n<li>Added an optional profile icon (avatar) next to the username, with an enable\/disable setting and adjustable size (16-128 px).<\/li>\n<li>Added the <code>[dp_user_role_display]<\/code> shortcode with per-shortcode overrides for template, colors, labels, and avatar.<\/li>\n<li>Added a live shortcode generator on the settings page with a copy button.<\/li>\n<li>Added bundled translations: Spanish, French, German, Hindi, and Gujarati.<\/li>\n<li>Styles are now loaded automatically on pages that only use the shortcode.<\/li>\n<\/ul>\n\n<h4>1.0<\/h4>\n\n<ul>\n<li>First release in the WordPress.org plugin directory.<\/li>\n<li>Displays the logged-in user's name and role on the front end using the <code>wp_body_open<\/code> hook.<\/li>\n<li>Settings page with enable\/disable toggle.<\/li>\n<li>Background, text, and label color pickers.<\/li>\n<li>Editable \"User\" and \"Role\" label text.<\/li>\n<li>5 selectable front-end display templates.<\/li>\n<\/ul>","raw_excerpt":"Show the logged-in user&#039;s name, role, and profile icon anywhere - editable labels, custom colors, 5 templates, and a shortcode.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/329071","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=329071"}],"author":[{"embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/dixitpujara"}],"wp:attachment":[{"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=329071"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=329071"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=329071"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=329071"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=329071"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/kk.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=329071"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}