{"id":923,"date":"2025-12-18T09:06:45","date_gmt":"2025-12-18T09:06:45","guid":{"rendered":"http:\/\/192.168.1.159\/wp_plugins\/dev\/kivicare-revamp\/2025\/12\/18\/patient-portal-widget\/"},"modified":"2026-02-18T04:37:39","modified_gmt":"2026-02-18T04:37:39","slug":"register-login","status":"publish","type":"post","link":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/kivicare-lite\/documentation\/shortcodes-widgets\/register-login\/","title":{"rendered":"KiviCare Register\/Login Shortcode"},"content":{"rendered":"<div class=\"nolwrap\">\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\">Overview<\/h2>\n\n\n\n<p>The <strong><code>KCRegisterLogin<\/code> shortcode<\/strong> provides a unified <strong>Login &amp; Registration interface<\/strong> for the <strong>KiviCare Clinic Management System<\/strong>.<br>It supports <strong>multiple user roles<\/strong>, <strong>Google reCAPTCHA v3<\/strong>, <strong>clinic selection<\/strong>, and <strong>flexible form customization<\/strong> through shortcode attributes.<\/p>\n\n\n\n<p><strong>Shortcode Tag:<\/strong><\/p>\n\n\n    <div class=\"docsy-code-block with-line-numbers\" data-language=\"javascript\">\n                \n        <div class=\"code-header\">\n            <span class=\"code-language\">JAVASCRIPT<\/span>\n            <button class=\"code-copy-btn\" aria-label=\"Copy code\">\n                <i class=\"ph ph-copy\"><\/i>\n                <span class=\"copy-text\">Copy<\/span>\n                <span class=\"copied-text\">Copied!<\/span>\n            <\/button>\n        <\/div>\n        \n        <div class=\"code-wrapper\">\n            <pre class=\"language-javascript\"><code class=\"language-javascript\">[kivicareRegisterLogin]\n<\/code><\/pre>\n            \n                            <div class=\"line-numbers-wrapper\" aria-hidden=\"true\">\n                                            <span class=\"line-number\">1<\/span>\n                                            <span class=\"line-number\">2<\/span>\n                                    <\/div>\n                    <\/div>\n        \n            <\/div>\n    \n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Shortcode Attributes<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\"><code><strong>initial_tab<\/strong><\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type:<\/strong> String<\/li>\n\n\n\n<li><strong>Default:<\/strong> <code>''<\/code> (empty)<\/li>\n\n\n\n<li><strong>Allowed Values:<\/strong> <code>login<\/code>, <code>register<\/code>, or empty<\/li>\n\n\n\n<li><strong>Description:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>login<\/code> \u2192 Displays only the login form<\/li>\n\n\n\n<li><code>register<\/code> \u2192 Displays only the registration form<\/li>\n\n\n\n<li>Empty \u2192 Shows login by default with tab switching enabled<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Example:<\/strong><code>[kivicareRegisterLogin initial_tab=\"register\"]<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\"><code><strong>redirect_url<\/strong><\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type:<\/strong> String<\/li>\n\n\n\n<li><strong>Default:<\/strong> <code>''<\/code> (empty)<\/li>\n\n\n\n<li><strong>Description:<\/strong><br>Redirects the user after a successful login.<br>If not provided, the system uses the default redirect or the current page.<\/li>\n\n\n\n<li><strong>Example:<\/strong><code>[kivicareRegisterLogin redirect_url=\"https:\/\/example.com\/dashboard\"]<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\"><code><strong>login_text<\/strong><\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type:<\/strong> String<\/li>\n\n\n\n<li><strong>Default:<\/strong> <code>''<\/code> (empty)<\/li>\n\n\n\n<li><strong>Description:<\/strong><br>Custom label for the <strong>Login<\/strong> tab. Uses default text if empty.<\/li>\n\n\n\n<li><strong>Example:<\/strong><code>[kivicareRegisterLogin login_text=\"Sign In\"]<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\"><code><strong>register_text<\/strong><\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type:<\/strong> String<\/li>\n\n\n\n<li><strong>Default:<\/strong> <code>''<\/code> (empty)<\/li>\n\n\n\n<li><strong>Description:<\/strong><br>Custom label for the <strong>Register<\/strong> tab. Uses default text if empty.<\/li>\n\n\n\n<li><strong>Example:<\/strong><code>[kivicareRegisterLogin register_text=\"Create Account\"]<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\"><code><strong>patient_role_only<\/strong><\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type:<\/strong> String<\/li>\n\n\n\n<li><strong>Default:<\/strong> <code>yes<\/code><\/li>\n\n\n\n<li><strong>Allowed Values:<\/strong> <code>yes<\/code>, <code>no<\/code><\/li>\n\n\n\n<li><strong>Description:<\/strong>\n<ul class=\"wp-block-list\">\n<li><code>yes<\/code> \u2192 Only <strong>Patient<\/strong> role is available<\/li>\n\n\n\n<li><code>no<\/code> \u2192 Roles are loaded from plugin settings or <code>userroles<\/code> attribute<\/li>\n<\/ul>\n<\/li>\n\n\n\n<li><strong>Example:<\/strong><code>[kivicareRegisterLogin patient_role_only=\"no\"]<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\"><code><strong>clinic_id<\/strong><\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type:<\/strong> Integer<\/li>\n\n\n\n<li><strong>Default:<\/strong> <code>''<\/code> (empty)<\/li>\n\n\n\n<li><strong>Description:<\/strong><br>Pre-selects a specific clinic in the registration form.<\/li>\n\n\n\n<li><strong>Example:<\/strong><code>[kivicareRegisterLogin clinic_id=\"5\"]<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h3 class=\"wp-block-heading\"><code><strong>userroles<\/strong><\/code><\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Type:<\/strong> String (comma-separated)<\/li>\n\n\n\n<li><strong>Default:<\/strong> <code>''<\/code> (empty)<\/li>\n\n\n\n<li><strong>Allowed Roles:<\/strong> <code>patient<\/code>, <code>doctor<\/code>, <code>receptionist<\/code><\/li>\n\n\n\n<li><strong>Description:<\/strong><br>Limits available registration roles.<br>Overrides <code>patient_role_only<\/code> when provided.<\/li>\n\n\n\n<li><strong>Example:<\/strong><code>[kivicareRegisterLogin userroles=\"patient,doctor\"]<\/code><\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Usage Examples<\/strong><\/h2>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Basic Login &amp; Registration (Patient Only)<\/strong><\/h5>\n\n\n    <div class=\"docsy-code-block with-line-numbers\" data-language=\"javascript\">\n                \n        <div class=\"code-header\">\n            <span class=\"code-language\">JAVASCRIPT<\/span>\n            <button class=\"code-copy-btn\" aria-label=\"Copy code\">\n                <i class=\"ph ph-copy\"><\/i>\n                <span class=\"copy-text\">Copy<\/span>\n                <span class=\"copied-text\">Copied!<\/span>\n            <\/button>\n        <\/div>\n        \n        <div class=\"code-wrapper\">\n            <pre class=\"language-javascript\"><code class=\"language-javascript\">[kivicareRegisterLogin]\n<\/code><\/pre>\n            \n                            <div class=\"line-numbers-wrapper\" aria-hidden=\"true\">\n                                            <span class=\"line-number\">1<\/span>\n                                            <span class=\"line-number\">2<\/span>\n                                    <\/div>\n                    <\/div>\n        \n            <\/div>\n    \n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Registration Form Only (Multiple Roles)<\/strong><\/h5>\n\n\n    <div class=\"docsy-code-block with-line-numbers\" data-language=\"javascript\">\n                \n        <div class=\"code-header\">\n            <span class=\"code-language\">JAVASCRIPT<\/span>\n            <button class=\"code-copy-btn\" aria-label=\"Copy code\">\n                <i class=\"ph ph-copy\"><\/i>\n                <span class=\"copy-text\">Copy<\/span>\n                <span class=\"copied-text\">Copied!<\/span>\n            <\/button>\n        <\/div>\n        \n        <div class=\"code-wrapper\">\n            <pre class=\"language-javascript\"><code class=\"language-javascript\">[kivicareRegisterLogin initial_tab=&quot;register&quot; patient_role_only=&quot;no&quot; userroles=&quot;patient,doctor&quot;]\n<\/code><\/pre>\n            \n                            <div class=\"line-numbers-wrapper\" aria-hidden=\"true\">\n                                            <span class=\"line-number\">1<\/span>\n                                            <span class=\"line-number\">2<\/span>\n                                    <\/div>\n                    <\/div>\n        \n            <\/div>\n    \n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Login Form Only with Custom Text<\/strong><\/h5>\n\n\n    <div class=\"docsy-code-block with-line-numbers\" data-language=\"javascript\">\n                \n        <div class=\"code-header\">\n            <span class=\"code-language\">JAVASCRIPT<\/span>\n            <button class=\"code-copy-btn\" aria-label=\"Copy code\">\n                <i class=\"ph ph-copy\"><\/i>\n                <span class=\"copy-text\">Copy<\/span>\n                <span class=\"copied-text\">Copied!<\/span>\n            <\/button>\n        <\/div>\n        \n        <div class=\"code-wrapper\">\n            <pre class=\"language-javascript\"><code class=\"language-javascript\">[kivicareRegisterLogin initial_tab=&quot;login&quot; login_text=&quot;Sign In&quot;]\n<\/code><\/pre>\n            \n                            <div class=\"line-numbers-wrapper\" aria-hidden=\"true\">\n                                            <span class=\"line-number\">1<\/span>\n                                            <span class=\"line-number\">2<\/span>\n                                    <\/div>\n                    <\/div>\n        \n            <\/div>\n    \n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Pre-selected Clinic with Redirect<\/strong><\/h5>\n\n\n    <div class=\"docsy-code-block with-line-numbers\" data-language=\"javascript\">\n                \n        <div class=\"code-header\">\n            <span class=\"code-language\">JAVASCRIPT<\/span>\n            <button class=\"code-copy-btn\" aria-label=\"Copy code\">\n                <i class=\"ph ph-copy\"><\/i>\n                <span class=\"copy-text\">Copy<\/span>\n                <span class=\"copied-text\">Copied!<\/span>\n            <\/button>\n        <\/div>\n        \n        <div class=\"code-wrapper\">\n            <pre class=\"language-javascript\"><code class=\"language-javascript\">[kivicareRegisterLogin clinic_id=&quot;3&quot; redirect_url=&quot;https:\/\/example.com\/patient-dashboard&quot;]\n<\/code><\/pre>\n            \n                            <div class=\"line-numbers-wrapper\" aria-hidden=\"true\">\n                                            <span class=\"line-number\">1<\/span>\n                                            <span class=\"line-number\">2<\/span>\n                                    <\/div>\n                    <\/div>\n        \n            <\/div>\n    \n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>Doctor Registration Only<\/strong><\/h5>\n\n\n    <div class=\"docsy-code-block with-line-numbers\" data-language=\"javascript\">\n                \n        <div class=\"code-header\">\n            <span class=\"code-language\">JAVASCRIPT<\/span>\n            <button class=\"code-copy-btn\" aria-label=\"Copy code\">\n                <i class=\"ph ph-copy\"><\/i>\n                <span class=\"copy-text\">Copy<\/span>\n                <span class=\"copied-text\">Copied!<\/span>\n            <\/button>\n        <\/div>\n        \n        <div class=\"code-wrapper\">\n            <pre class=\"language-javascript\"><code class=\"language-javascript\">[kivicareRegisterLogin initial_tab=&quot;register&quot; userroles=&quot;doctor&quot;]\n<\/code><\/pre>\n            \n                            <div class=\"line-numbers-wrapper\" aria-hidden=\"true\">\n                                            <span class=\"line-number\">1<\/span>\n                                            <span class=\"line-number\">2<\/span>\n                                    <\/div>\n                    <\/div>\n        \n            <\/div>\n    \n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>Features<\/strong><\/h2>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>1. Dual Tab Interface<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Login and Registration in separate tabs<\/li>\n\n\n\n<li>Single-form mode when <code>initial_tab<\/code> is set<\/li>\n\n\n\n<li>Smooth tab switching with message reset<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>2. User Role Management<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Supports <strong>Patient<\/strong>, <strong>Doctor<\/strong>, <strong>Receptionist<\/strong><\/li>\n\n\n\n<li>Role visibility controlled by:\n<ul class=\"wp-block-list\">\n<li>Plugin settings<\/li>\n\n\n\n<li><code>patient_role_only<\/code><\/li>\n\n\n\n<li><code>userroles<\/code> attribute<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>3. Google reCAPTCHA v3 Integration<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Automatically loads reCAPTCHA when enabled<\/li>\n\n\n\n<li>Token generation for login and registration<\/li>\n\n\n\n<li>Admin notice when reCAPTCHA is disabled<\/li>\n\n\n\n<li>Configurable from plugin settings<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>4. Clinic Selection<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fetches active clinics only<\/li>\n\n\n\n<li>Supports pre-selection via <code>clinic_id<\/code><\/li>\n\n\n\n<li>Integrated with frontend registration flow<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>5. Form Customization<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Custom tab labels<\/li>\n\n\n\n<li>Smart quote normalization<\/li>\n\n\n\n<li>Fully sanitized and escaped output<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>6. User Experience Enhancements<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Logged-in user detection with logout option<\/li>\n\n\n\n<li>Loading indicators<\/li>\n\n\n\n<li>Error &amp; success messages<\/li>\n\n\n\n<li>International phone number validation<\/li>\n\n\n\n<li>Password visibility toggle<\/li>\n\n\n\n<li>Optional gender field<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\" \/>\n\n\n\n<h5 class=\"wp-block-heading\"><strong>7. Security Features<\/strong><\/h5>\n\n\n\n<ul class=\"wp-block-list\">\n<li>WordPress nonce verification<\/li>\n\n\n\n<li>Input sanitization<\/li>\n\n\n\n<li>Output escaping<\/li>\n\n\n\n<li>reCAPTCHA protection<\/li>\n\n\n\n<li>Secure REST API usage<\/li>\n<\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>Complete guide to Patient Portal Widget in KiviCare Lite. Learn how to effectively use this feature with step-by-step instructions and best practices.<\/p>\n","protected":false},"author":12,"featured_media":0,"parent":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[21],"tags":[],"class_list":["post-923","post","type-post","status-publish","format-standard","hentry","category-shortcodes-widgets"],"featured_image_src":null,"author_info":{"display_name":"wordpressadminiq","author_link":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/author\/wordpressadminiq\/"},"_links":{"self":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts\/923","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/users\/12"}],"replies":[{"embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/comments?post=923"}],"version-history":[{"count":8,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts\/923\/revisions"}],"predecessor-version":[{"id":3000,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/posts\/923\/revisions\/3000"}],"wp:attachment":[{"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/media?parent=923"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/categories?post=923"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/documentation.iqonic.design\/kivicare-wordpress\/wp-json\/wp\/v2\/tags?post=923"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}