{"id":1362,"date":"2023-10-31T14:48:45","date_gmt":"2023-10-31T14:48:45","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=1362"},"modified":"2023-10-31T14:48:46","modified_gmt":"2023-10-31T14:48:46","slug":"userswp","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/userswp\/","title":{"rendered":"Userswp Shortcode"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Userswp 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 Userswp 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 Userswp 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\/userswp\/assets\/icon-128x128.png?rev=2784318\" 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\/userswp\" target=\"_blank\" rel=\"noopener\">\n                        UsersWP &#8211; Front-end login form, User Registration, User Profile &amp; Members Directory plugin for WordPress                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;UsersWP is a comprehensive WordPress plugin offering front-end login forms, user registration, user profiles and a members directory. Designed to enhance user management on your site.&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\u2605\u2606<\/span> (145)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 10000+\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>[userswp]<\/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\">Userswp [userswp] Shortcode<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The UsersWP Plugin shortcode is designed to output specific widget settings. It includes filters for customizing settings, defining classes, and applying attributes. It also handles enclosed shortcodes and previews.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[userswp]<\/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 userswp shortcode parameters and attributes:<\/p>\n\n\n<ul>\n<li><code>args<\/code> &#8211; an array of the current widget instance&#8217;s settings.<\/li>\n<li><code>content<\/code> &#8211; enclosed shortcode added to the special `html` argument.<\/li>\n<li><code>widget_ops['classname']<\/code> &#8211; used to set the class of the widget.<\/li>\n<li><code>no_wrap<\/code> &#8211; decides if the output is wrapped in a div or not.<\/li>\n<li><code>title<\/code> &#8211; the title of the widget or shortcode.<\/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 shortcode to output the desired widget based on its base_id.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[widget base_id=\"your_widget_base_id\" \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n<p>Using the shortcode to output the widget with a specific title, and disabling the wrapping div by setting no_wrap to true.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[widget base_id=\"your_widget_base_id\" title=\"My Custom Title\" no_wrap=\"true\" \/]<\/code><\/pre>\n\n\n<p>Applying the shortcode to output a widget with additional HTML content enclosed within the shortcode. The enclosed content will be added to the &#8216;html&#8217; argument of the widget.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[widget base_id=\"your_widget_base_id\"]Extra HTML content goes here.[\/widget]<\/code><\/pre>\n\n\n<p>Applying the shortcode to output a widget with a specific class name. This class name will be added to the wrapping div of the widget output.<\/p>\n\n\n<pre class=\"wp-block-code\"><code lang=\"php\" class=\"language-php\">[widget base_id=\"your_widget_base_id\" widget_ops=\"{classname: 'my-custom-class'}\" \/]<\/code><\/pre>\n\n\n<p>Please note that you need to replace &#8220;your_widget_base_id&#8221; with the actual base_id of the widget you want to output.<\/p>\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>[userswp]<\/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( $this-&gt;base_id, array( $this, 'shortcode_output' ) );<\/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 shortcode_output( $args = array(), $content = &#039;&#039; ) {\n\t\t\t$_instance = $args;\n\n\t\t\t$args = $this-&gt;argument_values( $args );\n\n\t\t\t\/\/ add extra argument so we know its a output to gutenberg\n\t\t\t\/\/$args\n\t\t\t$args = $this-&gt;string_to_bool( $args );\n\n\t\t\t\/\/ if we have a enclosed shortcode we add it to the special `html` argument\n\t\t\tif ( ! empty( $content ) ) {\n\t\t\t\t$args&#91;&#039;html&#039;] = $content;\n\t\t\t}\n\n\t\t\tif ( ! $this-&gt;is_preview() ) {\n\t\t\t\t\/**\n\t\t\t\t * Filters the settings for a particular widget args.\n\t\t\t\t *\n\t\t\t\t * @param array          $args      The current widget instance&#039;s settings.\n\t\t\t\t * @param WP_Super_Duper $widget    The current widget settings.\n\t\t\t\t * @param array          $_instance An array of default widget arguments.\n\t\t\t\t *\n\t\t\t\t *@since 1.0.28\n\t\t\t\t *\n\t\t\t\t *\/\n\t\t\t\t$args = apply_filters( &#039;wp_super_duper_widget_display_callback&#039;, $args, $this, $_instance );\n\n\t\t\t\tif ( ! is_array( $args ) ) {\n\t\t\t\t\treturn $args;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\t$class = isset( $this-&gt;options&#91;&#039;widget_ops&#039;]&#91;&#039;classname&#039;] ) ? esc_attr( $this-&gt;options&#91;&#039;widget_ops&#039;]&#91;&#039;classname&#039;] ) : &#039;&#039;;\n\t\t\t$class .= &quot; sdel-&quot;.$this-&gt;get_instance_hash();\n\n\t\t\t$class = apply_filters( &#039;wp_super_duper_div_classname&#039;, $class, $args, $this );\n\t\t\t$class = apply_filters( &#039;wp_super_duper_div_classname_&#039; . $this-&gt;base_id, $class, $args, $this );\n\n\t\t\t$attrs = apply_filters( &#039;wp_super_duper_div_attrs&#039;, &#039;&#039;, $args, $this );\n\t\t\t$attrs = apply_filters( &#039;wp_super_duper_div_attrs_&#039; . $this-&gt;base_id, &#039;&#039;, $args, $this );\n\n\t\t\t$shortcode_args = array();\n\t\t\t$output         = &#039;&#039;;\n\t\t\t$no_wrap        = isset( $this-&gt;options&#91;&#039;no_wrap&#039;] ) &amp;&amp; $this-&gt;options&#91;&#039;no_wrap&#039;] ? true : false;\n\t\t\tif ( isset( $args&#91;&#039;no_wrap&#039;] ) &amp;&amp; $args&#91;&#039;no_wrap&#039;] ) {\n\t\t\t\t$no_wrap = true;\n\t\t\t}\n\t\t\t$main_content = $this-&gt;output( $args, $shortcode_args, $content );\n\t\t\tif ( $main_content &amp;&amp; ! $no_wrap ) {\n\t\t\t\t\/\/ wrap the shortcode in a div with the same class as the widget\n\t\t\t\t$output .= &#039;&lt;div class=&quot;&#039; . $class . &#039;&quot; &#039; . $attrs . &#039;&gt;&#039;;\n\t\t\t\tif ( ! empty( $args&#91;&#039;title&#039;] ) ) {\n\t\t\t\t\t\/\/ if its a shortcode and there is a title try to grab the title wrappers\n\t\t\t\t\t$shortcode_args = array( &#039;before_title&#039; =&gt; &#039;&#039;, &#039;after_title&#039; =&gt; &#039;&#039; );\n\t\t\t\t\tif ( empty( $instance ) ) {\n\t\t\t\t\t\tglobal $wp_registered_sidebars;\n\t\t\t\t\t\tif ( ! empty( $wp_registered_sidebars ) ) {\n\t\t\t\t\t\t\tforeach ( $wp_registered_sidebars as $sidebar ) {\n\t\t\t\t\t\t\t\tif ( ! empty( $sidebar&#91;&#039;before_title&#039;] ) ) {\n\t\t\t\t\t\t\t\t\t$shortcode_args&#91;&#039;before_title&#039;] = $sidebar&#91;&#039;before_title&#039;];\n\t\t\t\t\t\t\t\t\t$shortcode_args&#91;&#039;after_title&#039;]  = $sidebar&#91;&#039;after_title&#039;];\n\t\t\t\t\t\t\t\t\tbreak;\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t\t$output .= $this-&gt;output_title( $shortcode_args, $args );\n\t\t\t\t}\n\t\t\t\t$output .= $main_content;\n\t\t\t\t$output .= &#039;&lt;\/div&gt;&#039;;\n\t\t\t} elseif ( $main_content &amp;&amp; $no_wrap ) {\n\t\t\t\t$output .= $main_content;\n\t\t\t}\n\n\t\t\t\/\/ if preview show a placeholder if empty\n\t\t\tif ( $this-&gt;is_preview() &amp;&amp; $output == &#039;&#039; ) {\n\t\t\t\t$output = $this-&gt;preview_placeholder_text( &quot;{{&quot; . $this-&gt;base_id . &quot;}}&quot; );\n\t\t\t}\n\n\t\t\treturn apply_filters( &#039;wp_super_duper_widget_output&#039;, $output, $args, $shortcode_args, $this );\n\t\t}\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\">userswp\/userswp\/vendor\/ayecode\/wp-super-duper\/wp-super-duper.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>Userswp 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 Userswp 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 Userswp Plugin shortcode not to show or not to work correctly. Before starting, here is an overview of the [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"name":"UsersWP &#8211; Front-end login form, User Registration, User Profile &amp; Members Directory plugin for WordPress","slug":"","version":"1.2.3.22","author":"<a href=\"https:\/\/userswp.io\">AyeCode Ltd<\/a>","icons":"https:\/\/ps.w.org\/userswp\/assets\/icon-128x128.png?rev=2784318","plugin_tags":"{\"login-form\":\"login form\",\"registration\":\"registration\",\"registration-form\":\"registration form\",\"user-profile\":\"user profile\",\"user-registration\":\"User Registration\"}","author_profile":"https:\/\/profiles.wordpress.org\/stiofansisland\/","requires":"4.9","tested":"6.3.2","requires_php":"false","rating":94,"num_ratings":145,"active_installs":10000,"downloaded":607593,"last_updated":"2023-09-06 11:24am GMT","added":"2017-07-27","homepage":"https:\/\/userswp.io\/","short_description":"Light weight Front-end login form, User Registration, User Profile and Members Directory plugin.","description":"\"UsersWP is a comprehensive WordPress plugin offering front-end login forms, user registration, user profiles and a members directory. Designed to enhance user management on your site.\"","shortcodes":"[\"userswp\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-1362","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1362","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=1362"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1362\/revisions"}],"predecessor-version":[{"id":1655,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/1362\/revisions\/1655"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=1362"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=1362"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=1362"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}