{"id":117,"date":"2025-02-06T12:40:03","date_gmt":"2025-02-06T12:40:03","guid":{"rendered":"https:\/\/documentation.userswp.io\/article\/how-to-add-new-tabs-to-user-account-page\/"},"modified":"2025-03-26T15:39:36","modified_gmt":"2025-03-26T15:39:36","slug":"how-to-add-new-tabs-to-user-account-page","status":"publish","type":"gd_place","link":"https:\/\/userswp.io\/documentation\/article\/code-snippets\/how-to-add-new-tabs-to-user-account-page\/","title":{"rendered":"How to Add New Tabs to User Account Page?"},"content":{"rendered":"\n<p>In UsersWP, you can easily add profile tabs to user profile pages using our <strong>Form Builder. <\/strong>However, if you wish to add custom content to the account page, you must use a code snippet.&nbsp;<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Code Snippet to Add Custom Content to User Account Page<\/h2>\n\n\n\n<p>You can use the following code snippet to add custom content to the user account page.&nbsp; &nbsp;<\/p>\n\n\n\n<div class=\"wp-block-blockstrap-blockstrap-widget-alert d-flex align-items-center fade show alert alert-info mb-3\" role=\"alert\"><span class=\"fas fa-info-circle me-2\"><\/span><span class=\"flex-grow-1\">We recommend using the <a href=\"https:\/\/wpgeodirectory.com\/documentation\/article\/useful-plugins\/code-snippets-plugin\/\" target=\"_blank\">Code Snippets<\/a> plugin to add snippets to your site.<\/span><\/div>\n\n\n\n<pre class=\"wp-block-prismatic-blocks\"><code class=\"language-php\">add_filter(&#039;uwp_account_available_tabs&#039;, &#039;uwp_account_available_tabs_cb&#039;, 10, 1);\nfunction uwp_account_available_tabs_cb($tabs){\n\n\t$tabs[&#039;new-tab&#039;] = array(\n\t\t&#039;title&#039; =&gt; __( &#039;My new tab&#039;, &#039;userswp&#039; ),\n\t\t&#039;icon&#039;  =&gt; &#039;fas fa-user&#039;,\n\t);\n\n    return $tabs;\n}\n\nadd_filter(&#039;uwp_account_page_title&#039;, &#039;uwp_account_page_title_cb&#039;, 10, 2);\nfunction uwp_account_page_title_cb($title, $type){\n\tif ( $type == &#039;new-tab&#039; ) {\n\t\t$title = __( &#039;My new tab title&#039;, &#039;uwp-messaging&#039; );\n\t}\n\n\treturn $title;\n}\n\nadd_filter(&#039;uwp_account_form_display&#039;, &#039;uwp_account_form_display_cb&#039;, 10, 1);\nfunction uwp_account_form_display_cb($type){\n\tif ( $type == &#039;new-tab&#039; ) {\n        echo &#039;Your custom content goes here...&#039;;\n\t}\n}\n<\/code><\/pre>\n\n\n\n<p><\/p>\n\n\n\n<p>You can use any shortcode, PHP function or custom text&nbsp;in place of &#8220;Your custom content goes here&#8230;&#8221;.&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In UsersWP, you can easily add profile tabs to user profile pages using our Form Builder. However, if you wish to add custom content to the account page, you must use a code snippet.&nbsp; Code Snippet to Add Custom Content to User Account Page You can use the following code snippet to add custom content [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","template":"","meta":{"footnotes":""},"article\/tags":[173,174,172],"article\/categories":[40,7],"class_list":["post-117","gd_place","type-gd_place","status-publish","hentry","gd_place_tags-user-account","gd_place_tags-custom-tabs","gd_place_tags-profile-tabs","gd_placecategory-code-snippets","gd_placecategory-tips-tricks-more"],"_links":{"self":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article"}],"about":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/types\/gd_place"}],"author":[{"embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":0,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"gd_place_tags","embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/tags?post=117"},{"taxonomy":"gd_placecategory","embeddable":true,"href":"https:\/\/userswp.io\/documentation\/wp-json\/wp\/v2\/article\/categories?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}