{"id":455,"date":"2023-10-21T06:38:24","date_gmt":"2023-10-21T06:38:24","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=455"},"modified":"2023-10-21T06:38:25","modified_gmt":"2023-10-21T06:38:25","slug":"theme-my-login","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/theme-my-login\/","title":{"rendered":"Theme My Login Shortcode"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Theme My Login Shortcode<\/strong> to your WordPress website, including its <strong>parameters<\/strong>, <strong>examples<\/strong>, and <strong>PHP function code<\/strong>. Additionally, we&#8217;ll assist you with common issues that might cause the Theme My Login Plugin shortcode not to show or not to work correctly.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before starting, here is an overview of the Theme My Login Plugin and the shortcodes it provides:<\/p>\n\n\n<p>    <div class=\"plugin-info-box\">\n        <div class=\"top-main\">\n            <!-- SVG Image -->\n            <div class=\"plugin-image\">\n                <img decoding=\"async\" src=\"https:\/\/ps.w.org\/theme-my-login\/assets\/icon-128x128.png?rev=1891232\" alt=\"Plugin Icon\" \/>\n            <\/div>\n            \n            <div class=\"plugin-descriptive-part\">\n                <!-- Plugin Name with Link -->\n\n                    <a class=\"plugin-title\" href=\"https:\/\/wordpress.org\/plugins\/theme-my-login\" target=\"_blank\" rel=\"noopener\">\n                        Theme My Login                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Theme My Login is a powerful WordPress plugin that allows you to customize your login, registration, and password recovery pages to match your theme for a seamless user experience.&quot;                <\/p>\n            <\/div>\n        <\/div>\n\n        <!-- Rating and Additional Info -->\n        <div class=\"plugin-meta\">\n            <span class=\"plugin-rating\">\n                <span class='stars'>\u2605\u2605\u2605\u2606\u2729<\/span> (456)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 90000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 6.3.2            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: false            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[theme-my-login]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Theme My Login [theme-my-login] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The Theme-My-Login shortcode is a powerful tool that allows you to customize user actions. It provides options to specify default actions, show links, and set redirection paths.\n\n \n\nThe shortcode function &#8216;tml_shortcode&#8217; takes in attributes and processes them. If no action is specified, it defaults to the &#8216;login&#8217; action. It also allows for customization of the login form and dashboard view. \n\nThe shortcode ensures a smooth user experience, with options for account request confirmation and user-specific dashboard greetings. It also provides easy access to important links like &#8216;Site Admin&#8217;, &#8216;Edit Profile&#8217;, and &#8216;Log Out&#8217;. \n\nIn conclusion, the Theme-My-Login shortcode is a versatile tool for enhancing user interaction and experience on your WordPress site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[theme-my-login]<\/code><\/p>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Parameters<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Here is a list of all possible theme-my-login shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>default_action<\/code> &#8211; Defines the initial action of the login form.<\/li>\n<li><code>action<\/code> &#8211; Determines the specific action of the form.<\/li>\n<li><code>show_links<\/code> &#8211; Controls the visibility of form links.<\/li>\n<li><code>redirect_to<\/code> &#8211; Specifies the URL to redirect after form submission.<\/li>\n<\/ul>\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n\n\n<p><strong>Basic example<\/strong> &#8211; A simple usage of the theme-my-login shortcode without any parameters. This will default to the login action.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[theme-my-login \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Using the shortcode to display a login form with links to registration and lost password page. The &#8216;show_links&#8217; attribute is set to true.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[theme-my-login show_links=\"true\" \/]<\/code><\/pre>\n\n\n<p>Using the shortcode to display a login form with a specific redirection after login. The &#8216;redirect_to&#8217; attribute is used to specify the URL to redirect to after login.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[theme-my-login redirect_to=\"https:\/\/www.example.com\/dashboard\" \/]<\/code><\/pre>\n\n\n<p>Using the shortcode to display a specific action form. The &#8216;action&#8217; attribute is used to specify the action form to display. Possible actions include &#8216;login&#8217;, &#8216;register&#8217;, &#8216;lostpassword&#8217;, &#8216;resetpass&#8217;, and &#8216;confirmaction&#8217;.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[theme-my-login action=\"register\" \/]<\/code><\/pre>\n\n\n<p>Combining multiple attributes to display a register form with links and a specific redirection after registration.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[theme-my-login action=\"register\" show_links=\"true\" redirect_to=\"https:\/\/www.example.com\/welcome\" \/]<\/code><\/pre>\n\n\n\n<div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h3 class=\"wp-block-heading\">PHP Function Code<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">In case you have difficulties debugging what causing issues with <code>[theme-my-login]<\/code> shortcode, check below the related PHP functions code.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode line<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">add_shortcode( 'theme-my-login', 'tml_shortcode' );<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode PHP function<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: php; light: false; title: ; toolbar: true; notranslate\" title=\"\">\nfunction tml_shortcode( $atts = array() ) {\n\t$atts = (array) $atts;\n\n\tif ( isset( $atts&#91;&#039;default_action&#039;] ) ) {\n\t\t$atts&#91;&#039;action&#039;] = $atts&#91;&#039;default_action&#039;];\n\t}\n\n\t$atts = shortcode_atts( array(\n\t\t&#039;action&#039;      =&gt; &#039;&#039;,\n\t\t&#039;show_links&#039;  =&gt; null,\n\t\t&#039;redirect_to&#039; =&gt; null,\n\t), $atts, &#039;theme-my-login&#039; );\n\n\t$content = &#039;&#039;;\n\n\tif ( empty( $atts&#91;&#039;action&#039;] ) ) {\n\t\t$action = tml_is_action() ? tml_get_action() : tml_get_action( &#039;login&#039; );\n\t} elseif ( ! $action = tml_get_action( $atts&#91;&#039;action&#039;] ) ) {\n\t\treturn $content;\n\t}\n\n\tif ( $form = tml_get_form( $action-&gt;get_name() ) ) {\n\n\t\t$args = array();\n\n\t\tif ( null !== $atts&#91;&#039;show_links&#039;] ) {\n\t\t\t$args&#91;&#039;show_links&#039;] = (bool) $atts&#91;&#039;show_links&#039;];\n\t\t}\n\n\t\tif ( null !== $atts&#91;&#039;redirect_to&#039;] ) {\n\t\t\tif ( $redirect_to = $form-&gt;get_field( &#039;redirect_to&#039; ) ) {\n\t\t\t\t$redirect_to-&gt;set_value( $atts&#91;&#039;redirect_to&#039;] );\n\t\t\t}\n\t\t\tunset( $redirect_to );\n\t\t}\n\n\t\t$content = $form-&gt;render( $args );\n\n\t} elseif ( &#039;confirmaction&#039; == $action-&gt;get_name() &amp;&amp; isset( $_GET&#91;&#039;request_id&#039;] ) ) {\n\t\t$content = _wp_privacy_account_request_confirmed_message( $_GET&#91;&#039;request_id&#039;] );\n\n\t} elseif ( &#039;dashboard&#039; == $action-&gt;get_name() ) {\n\t\t$content = &#039;&lt;div class=&quot;tml-dashboard&quot;&gt;&#039;;\n\n\t\t$content .= &#039;&lt;div class=&quot;tml-dashboard-avatar&quot;&gt;&#039; . get_avatar( get_current_user_id() ) . &#039;&lt;\/div&gt;&#039;;\n\n\t\t$content .= &#039;&lt;p class=&quot;tml-dashboard-greeting&quot;&gt;&#039; . sprintf( __( &#039;Howdy, %s&#039; ), wp_get_current_user()-&gt;display_name ) . &#039;&lt;\/p&gt;&#039;;\n\n\t\t\/**\n\t\t * Filter the dashboard links.\n\t\t *\n\t\t * @since 7.1\n\t\t *\n\t\t * @param array $links The dashboard links.\n\t\t *\/\n\t\t$links = apply_filters( &#039;tml_dashboard_links&#039;, array_filter( array(\n\t\t\t&#039;site_admin&#039; =&gt; current_user_can( &#039;edit_posts&#039; ) ? array(\n\t\t\t\t&#039;title&#039;  =&gt; __( &#039;Site Admin&#039; ),\n\t\t\t\t&#039;url&#039;    =&gt; admin_url(),\n\t\t\t) : false,\n\t\t\t&#039;profile&#039;    =&gt; array(\n\t\t\t\t&#039;title&#039;  =&gt; __( &#039;Edit Profile&#039; ),\n\t\t\t\t&#039;url&#039;    =&gt; admin_url( &#039;profile.php&#039; ),\n\t\t\t),\n\t\t\t&#039;logout&#039;     =&gt; array(\n\t\t\t\t&#039;title&#039;  =&gt; __( &#039;Log Out&#039; ),\n\t\t\t\t&#039;url&#039;    =&gt; wp_logout_url(),\n\t\t\t),\n\t\t) ) );\n\n\t\tif ( ! empty( $links ) ) {\n\t\t\t$content .= &#039;&lt;ul class=&quot;tml-dashboard-links&quot;&gt;&#039;;\n\t\t\tforeach ( $links as $link ) {\n\t\t\t\t$content .= &#039;&lt;li&gt;&lt;a href=&quot;&#039; . esc_url( $link&#91;&#039;url&#039;] ) . &#039;&quot;&gt;&#039; . esc_html( $link&#91;&#039;title&#039;] ) . &#039;&lt;\/a&gt;&lt;\/li&gt;&#039;;\n\t\t\t}\n\t\t\t$content .= &#039;&lt;\/ul&gt;&#039;;\n\t\t}\n\n\t\t$content .= &#039;&lt;\/div&gt;&#039;;\n\t}\n\n\t\/**\n\t * Filter the shortcode content.\n\t *\n\t * @since 7.0\n\t *\n\t * @param string $content The shortcode content.\n\t * @param string $action  The action name.\n\t * @param array  $atts    The shortcode attributes.\n\t *\/\n\treturn apply_filters( &#039;tml_shortcode&#039;, $content, $action-&gt;get_name(), $atts );\n}\n<\/pre><\/div>\n\n\n<p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">theme-my-login\/theme-my-login\/includes\/shortcodes.php<\/code><\/pre>\n\n\n\n<div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Now that you&#8217;ve learned how to embed the <strong>Theme My Login Plugin shortcode<\/strong>, understood the parameters, and seen code examples, it&#8217;s easy to use and debug any issue that might cause it to &#8216;not work&#8217;. If you still have difficulties with it, don&#8217;t hesitate to leave a comment below.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Below, you&#8217;ll find a detailed guide on how to add the Theme My Login Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Theme My Login Plugin shortcode not to show or not to work correctly. Before starting, here is [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"Theme My Login","slug":"","version":"7.1.6","author":"<a href=\"https:\/\/thememylogin.com\">Theme My Login<\/a>","icons":"https:\/\/ps.w.org\/theme-my-login\/assets\/icon-128x128.png?rev=1891232","plugin_tags":"{\"branding\":\"branding\",\"customize\":\"customize\",\"login\":\"login\",\"password\":\"password\",\"register\":\"register\"}","author_profile":"https:\/\/profiles.wordpress.org\/jfarthing84\/","requires":"5.4","tested":"6.3.2","requires_php":"false","rating":74,"num_ratings":456,"active_installs":90000,"downloaded":3878491,"last_updated":"2023-08-04 5:43pm GMT","added":"2009-03-13","homepage":"https:\/\/thememylogin.com","short_description":"The ultimate login branding solution! Theme My Login offers matchless customization of your WordPress user experience!","description":"\"Theme My Login is a powerful WordPress plugin that allows you to customize your login, registration, and password recovery pages to match your theme for a seamless user experience.\"","shortcodes":"[\"theme-my-login\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-455","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/comments?post=455"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"predecessor-version":[{"id":597,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/455\/revisions\/597"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}