{"id":2076,"date":"2023-12-10T11:30:47","date_gmt":"2023-12-10T11:30:47","guid":{"rendered":"https:\/\/wpshortcode.org\/?p=2076"},"modified":"2023-12-10T11:30:47","modified_gmt":"2023-12-10T11:30:47","slug":"wp-sponsors","status":"publish","type":"post","link":"https:\/\/wpshortcode.org\/wp-sponsors\/","title":{"rendered":"Sponsors Shortcodes"},"content":{"rendered":"\n        \n        <p class=\"wp-block-paragraph\">Below, you&#8217;ll find a detailed guide on how to add the <strong>Sponsors Shortcodes<\/strong> to your WordPress website, including their <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 Sponsors Plugin shortcodes 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 Sponsors 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\/wp-sponsors\/assets\/icon-128x128.png?rev=1170378\" 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\/wp-sponsors\" target=\"_blank\" rel=\"noopener\">\n                        Sponsors                    <\/a>\n\n\n                <!-- Plugin Description -->\n                <p class=\"plugin-description\">\n                    &quot;Sponsors is a WordPress plugin that allows you to manage and display your site sponsors in an organized and professional manner. Use wp-sponsors to enhance your site&#039;s revenue potential.&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> (8)\n            <\/span>\n            <span class=\"plugin-active-installs\">\n                <strong>Active Installs<\/strong>: 3000+\n            <\/span>\n            <span class=\"plugin-tested\">\n                <strong>Tested with<\/strong>: 5.7.10            <\/span>\n            <span class=\"plugin-php-version\">\n                <strong>PHP Version<\/strong>: 7.0            <\/span>\n        <\/div>\n\n        <!-- List of Included Shortcodes -->\n        <div class=\"plugin-shortcodes\">\n            <strong>Included Shortcodes:<\/strong>\n            <ul>\n                <li>[sponsors]<\/li><li>[sponsors_acquisition_form]<\/li>            <\/ul>\n        <\/div>\n    <\/div>\n    <\/p>\n\n            <div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n            \n            \n            <h2 class=\"wp-block-heading\">Sponsors [sponsors] Shortcode<\/h2>\n            \n            \n            \n            <p class=\"wp-block-paragraph\">The WP-Sponsors shortcode is a powerful tool for displaying sponsors on your WordPress site. It allows you to customize the display using attributes like &#8216;type&#8217;, &#8216;image&#8217;, &#8216;category&#8217;, &#8216;style&#8217;, and more. \n\n \n\nThis shortcode retrieves sponsor posts, applies specified attributes, and outputs them in a formatted style. It supports various layouts like list, grid, and slider. It also enables category-based grouping of sponsors. \n\nShortcode: [sponsors_shortcode]<\/p>\n            \n\n            \n            <p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[sponsors]<\/code><\/p>\n            \n            \n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\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 sponsors shortcode parameters and attributes:<\/p>\n                \n                \n                <ul>\n<li><code>type<\/code> &#8211; Specifies the type of post to display.<\/li>\n<li><code>image<\/code> &#8211; If set to &#8216;yes&#8217;, sponsor&#8217;s image will be displayed.<\/li>\n<li><code>images<\/code> &#8211; If set to &#8216;yes&#8217;, all sponsor&#8217;s images will be displayed.<\/li>\n<li><code>category<\/code> &#8211; Specifies the category of the sponsors to display.<\/li>\n<li><code>with_categories<\/code> &#8211; If &#8216;yes&#8217;, sponsors will be grouped by categories.<\/li>\n<li><code>category_title<\/code> &#8211; Defines the HTML tag for the category title.<\/li>\n<li><code>size<\/code> &#8211; Specifies the size of the sponsors display.<\/li>\n<li><code>image_size<\/code> &#8211; Defines the size of the sponsor&#8217;s image.<\/li>\n<li><code>slider_image<\/code> &#8211; Specifies the size of the image in the slider.<\/li>\n<li><code>style<\/code> &#8211; Sets the layout style of the sponsors display.<\/li>\n<li><code>description<\/code> &#8211; If &#8216;yes&#8217;, sponsor&#8217;s description will be displayed.<\/li>\n<li><code>orderby<\/code> &#8211; Specifies the order attribute for the sponsors display.<\/li>\n<li><code>order<\/code> &#8211; Sets the order direction of the sponsors display.<\/li>\n<li><code>title<\/code> &#8211; If &#8216;yes&#8217;, sponsor&#8217;s title will be displayed.<\/li>\n<li><code>max<\/code> &#8211; Sets the maximum number of sponsors to display.<\/li>\n<li><code>adaptiveheight<\/code> &#8211; If &#8216;1&#8217;, slider height will adapt to each slide.<\/li>\n<li><code>autoplay<\/code> &#8211; If &#8216;1&#8217;, the slider will play automatically.<\/li>\n<li><code>autoplayspeed<\/code> &#8211; Sets the speed of the slider autoplay in milliseconds.<\/li>\n<li><code>arrows<\/code> &#8211; If &#8216;1&#8217;, arrows will be displayed for slider navigation.<\/li>\n<li><code>centermode<\/code> &#8211; If &#8216;1&#8217;, slides will be displayed in the center mode.<\/li>\n<li><code>dots<\/code> &#8211; If &#8216;1&#8217;, navigation dots will be displayed under the slider.<\/li>\n<li><code>infinite<\/code> &#8211; If &#8216;1&#8217;, the slider will loop infinitely.<\/li>\n<li><code>slidestoshow<\/code> &#8211; Sets the number of slides to show at a time.<\/li>\n<li><code>slidestoscroll<\/code> &#8211; Sets the number of slides to scroll at a time.<\/li>\n<li><code>variablewidth<\/code> &#8211; If &#8216;1&#8217;, slides will have variable widths.<\/li>\n<li><code>verticalcenter<\/code> &#8211; If &#8216;1&#8217;, slides will be vertically centered.<\/li>\n<li><code>breakpoints<\/code> &#8211; Sets the breakpoints for responsive design.<\/li>\n<li><code>debug<\/code> &#8211; If set, debug mode will be activated.<\/li>\n<\/ul>\n    \n                \n                <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n                \n                <h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n                \n \n            <p><strong>Basic example<\/strong> &#8211; Displaying all sponsors in a list format<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors style=\"list\" \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n\n<p>Displaying sponsors in a slider format, with autoplay enabled and an autoplay speed of 5000 milliseconds.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors style=\"slider\" autoplay=\"1\" autoplayspeed=\"5000\" \/]<\/code><\/pre>\n\n\n<p>Displaying sponsors from a specific category in a grid format, with the sponsor&#8217;s description and title included.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors style=\"grid\" category=\"your-category\" description=\"yes\" title=\"yes\" \/]<\/code><\/pre>\n\n\n<p>Displaying a maximum of 5 sponsors in a list format, ordered by the menu order in ascending order.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors style=\"list\" max=\"5\" orderby=\"menu_order\" order=\"ASC\" \/]<\/code><\/pre>\n\n\n<p>Displaying sponsors in a slider format, with variable width and centered mode enabled.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors style=\"slider\" variablewidth=\"1\" centermode=\"1\" \/]<\/code><\/pre>\n\n\n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\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>[sponsors]<\/code> shortcode, check below the related PHP functions code.<\/p>\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( 'sponsors', array( __CLASS__, 'sponsors_shortcode' ) );<\/code><\/pre>\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=\"\">\n                    function sponsors_shortcode( $atts = array() ) {\n\t\t$atts = shortcode_atts( array (\n\t\t\t&#039;type&#039; =&gt; &#039;post&#039;,\n\t\t\t&#039;image&#039; =&gt; &#039;yes&#039;,\n\t\t\t&#039;images&#039; =&gt; &#039;yes&#039;,\n\t\t\t&#039;category&#039; =&gt; &#039;&#039;,\n\t\t\t&#039;with_categories&#039; =&gt; &#039;no&#039;,\n\t\t\t&#039;category_title&#039; =&gt; &#039;h3&#039;,\n\t\t\t&#039;size&#039; =&gt; &#039;default&#039;,\n\t\t\t&#039;image_size&#039; =&gt; &#039;medium&#039;,\n\t\t\t&#039;slider_image&#039; =&gt; &#039;full&#039;,\n\t\t\t&#039;style&#039; =&gt; &#039;list&#039;,\n\t\t\t&#039;description&#039; =&gt; &#039;no&#039;,\n\t\t\t&#039;orderby&#039; =&gt; &#039;menu_order&#039;,\n\t\t\t&#039;order&#039; =&gt; &#039;ASC&#039;,\n\t\t\t&#039;title&#039; =&gt; &#039;no&#039;,\n\t\t\t&#039;max&#039; =&gt; &#039;-1&#039;,\n\t\t\t&#039;adaptiveheight&#039; =&gt; &#039;1&#039;,\n\t\t\t&#039;autoplay&#039; =&gt; &#039;1&#039;,\n\t\t\t&#039;autoplayspeed&#039; =&gt; &#039;3000&#039;,\n\t\t\t&#039;arrows&#039; =&gt; &#039;1&#039;,\n\t\t\t&#039;centermode&#039; =&gt; &#039;0&#039;,\n\t\t\t&#039;dots&#039; =&gt; &#039;0&#039;,\n\t\t\t&#039;infinite&#039; =&gt; &#039;1&#039;,\n\t\t\t&#039;slidestoshow&#039; =&gt; &#039;1&#039;,\n\t\t\t&#039;slidestoscroll&#039; =&gt; &#039;1&#039;,\n\t\t\t&#039;variablewidth&#039; =&gt; &#039;0&#039;,\n\t\t\t&#039;verticalcenter&#039; =&gt; &#039;1&#039;,\n\t\t\t&#039;breakpoints&#039; =&gt; &#039;&#039;,\n\t\t\t&#039;debug&#039; =&gt; NULL\n\t\t), $atts, &#039;wp_sponsors&#039; );\n\n\t\t$args = array (\n\t\t\t&#039;post_type&#039;      =&gt; array( &#039;sponsors&#039;, &#039;sponsor&#039; ), \/\/ Allowing &#039;sponsor&#039; in case the update does not work.\n\t\t\t&#039;post_status&#039;    =&gt; &#039;publish&#039;,\n\t\t\t&#039;pagination&#039;     =&gt; false,\n\t\t\t&#039;no_found_rows&#039;  =&gt; true,\n\t\t\t&#039;order&#039;          =&gt; $atts&#91;&#039;order&#039;],\n\t\t\t&#039;orderby&#039;        =&gt; isset( $atts&#91;&#039;orderby&#039;] ) ? $atts&#91;&#039;orderby&#039;] : &#039;menu_order&#039;,\n\t\t\t&#039;posts_per_page&#039; =&gt; isset( $atts&#91;&#039;max&#039;] ) ? $atts&#91;&#039;max&#039;] : &#039;-1&#039;,\n\t\t\t&#039;tax_query&#039;      =&gt; array(),\n\t\t);\n\n\t\t$nofollow = ( defined( &#039;SPONSORS_NO_FOLLOW&#039; ) ) ? SPONSORS_NO_FOLLOW : true;\n\n\t\tif( $atts&#91;&#039;category&#039;] ) {\n\t\t\t$atts&#91;&#039;category&#039;] = explode( &#039;,&#039;, $atts&#91;&#039;category&#039;] );\n\t\t\t$args&#91;&#039;tax_query&#039;] = array(\n\t\t\t\tarray(\n\t\t\t\t\t&#039;taxonomy&#039;  =&gt; &#039;sponsor_categories&#039;,\n\t\t\t\t\t&#039;field&#039;     =&gt; &#039;slug&#039;,\n\t\t\t\t\t&#039;terms&#039;     =&gt; $atts&#91;&#039;category&#039;],\n\t\t\t\t),\n\t\t\t);\n\t\t}\n\n\t\t$images        = &#039;no&#039; !== $atts&#91;&#039;images&#039;] &amp;&amp; &#039;no&#039; !== $atts&#91;&#039;image&#039;] ? true : false;\n\t\t$debug         = $atts&#91;&#039;debug&#039;] ? true : false;\n\t\t$description   = &#039;yes&#039; === $atts&#91;&#039;description&#039;] ? true : false;\n\t\t$title         = &#039;yes&#039; === $atts&#91;&#039;title&#039;] ? true : false;\n\t\t$sponsor_posts = get_posts( $args );\n\t\t$sponsors      = array();\n\t\t$categories    = array();\n\t\t$slickSettings = array();\n\n\t\tforeach ( $sponsor_posts as $sponsor_post ) {\n\t\t\t$link = get_post_meta( $sponsor_post-&gt;ID, &#039;_website&#039;, true );\n\n\t\t\tif ( ! $link ) {\n\t\t\t\t$link = get_post_meta( $sponsor_post-&gt;ID, &#039;wp_sponsors_url&#039;, true );\n\t\t\t}\n\n\t\t\t$sponsor                = array();\n\t\t\t$sponsor&#91;&#039;id&#039;]          = $sponsor_post-&gt;ID;\n\t\t\t$sponsor&#91;&#039;link&#039;]        = $link;\n\t\t\t$sponsor&#91;&#039;link_target&#039;] = get_post_meta( $sponsor_post-&gt;ID, &#039;wp_sponsor_link_behaviour&#039;, true );\n\t\t\t$sponsor&#91;&#039;logo&#039;]        = get_the_post_thumbnail( $sponsor_post-&gt;ID, $atts&#91;&#039;image_size&#039;] );\n\t\t\t$sponsor&#91;&#039;title&#039;]       = get_the_title( $sponsor_post );\n\t\t\t$sponsor&#91;&#039;categories&#039;]  = get_the_terms( $sponsor_post, &#039;sponsor_categories&#039;);\n\t\t\t$desc = do_shortcode( wpautop( $sponsor_post-&gt;post_content ) );\n\t\t\tif ( ! $desc ) {\n\t\t\t\t$desc = get_post_meta( $sponsor_post-&gt;ID, &#039;wp_sponsors_desc&#039;, true );\n\t\t\t}\n\n\n\t\t\t$sponsor&#91;&#039;desc&#039;] = $desc;\n\t\t\t$sponsors&#91;] = $sponsor;\n\t\t}\n\n\t\tif( &#039;yes&#039; === $atts&#91;&#039;with_categories&#039;] ) {\n\t\t\tforeach( $sponsors as $sponsor ) {\n\t\t\t\tif ( $sponsor&#91;&#039;categories&#039;] ) {\n\t\t\t\t\tforeach ( $sponsor&#91;&#039;categories&#039;] as $term ) {\n\t\t\t\t\t\tif ( ! isset( $categories&#91; $term-&gt;term_id ] ) ) {\n\t\t\t\t\t\t\t$categories&#91; $term-&gt;term_id ] = array(\n\t\t\t\t\t\t\t\t&#039;title&#039; =&gt; $term-&gt;name,\n\t\t\t\t\t\t\t\t&#039;slug&#039;  =&gt; $term-&gt;slug,\n\t\t\t\t\t\t\t\t&#039;sponsors&#039; =&gt; array()\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t}\n\t\t\t\t\t\t$categories&#91; $term-&gt;term_id ]&#91;&#039;sponsors&#039;]&#91;] = $sponsor;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t} else {\n\t\t\t\/\/ Get all under one category so we can iterate through them.\n\t\t\t$categories&#91;0] = array( &#039;title&#039; =&gt; &#039;&#039;, &#039;slug&#039; =&gt; &#039;&#039;,  &#039;sponsors&#039; =&gt; $sponsors );\n\t\t}\n\n\n\n\t\tob_start();\n\n\t\t\/\/ Set up the shortcode styles\n\t\t$style = array();\n\t\t$layout = $atts&#91;&#039;style&#039;];\n\n\t\tswitch ( $layout ) {\n\t\t\tcase &quot;list&quot;:\n\t\t\t\t$style&#91;&#039;containerPre&#039;] = &#039;&lt;div id=&quot;wp-sponsors&quot;&gt;&lt;ul&gt;&#039;;\n\t\t\t\t$style&#91;&#039;containerPost&#039;] = &#039;&lt;\/ul&gt;&lt;\/div&gt;&#039;;\n\t\t\t\t$style&#91;&#039;wrapperClass&#039;] = &#039;sponsor-item&#039;;\n\t\t\t\t$style&#91;&#039;wrapperPre&#039;] = &#039;li&#039;;\n\t\t\t\t$style&#91;&#039;wrapperPost&#039;] = &#039;&lt;\/li&gt;&#039;;\n\t\t\t\tbreak;\n\t\t\tcase &quot;linear&quot;:\n\t\t\tcase &quot;grid&quot;:\n\t\t\t\t$style&#91;&#039;containerPre&#039;] = &#039;&lt;div id=&quot;wp-sponsors&quot; class=&quot;clearfix grid&quot;&gt;&#039;;\n\t\t\t\t$style&#91;&#039;containerPost&#039;] = &#039;&lt;\/div&gt;&#039;;\n\t\t\t\t$style&#91;&#039;wrapperClass&#039;] = &#039;sponsor-item&#039;;\n\t\t\t\t$style&#91;&#039;wrapperPre&#039;] = &#039;div&#039;;\n\t\t\t\t$style&#91;&#039;wrapperPost&#039;] = &#039;&lt;\/div&gt;&#039;;\n\t\t\t\tbreak;\n\t\t\tcase &quot;slider&quot;:\n\t\t\t\t$slickSettings&#91;&#039;adaptiveHeight&#039;] = $atts&#91;&#039;adaptiveheight&#039;] === &#039;1&#039; ? true : false;\n\t\t\t\t$slickSettings&#91;&#039;autoplay&#039;]       = $atts&#91;&#039;autoplay&#039;] === &#039;1&#039; ? true : false;\n\t\t\t\t$slickSettings&#91;&#039;autoplaySpeed&#039;]  = $atts&#91;&#039;autoplayspeed&#039;];\n\t\t\t\t$slickSettings&#91;&#039;arrows&#039;]         = $atts&#91;&#039;arrows&#039;] === &#039;1&#039; ? true : false;\n\t\t\t\t$slickSettings&#91;&#039;centerMode&#039;]     = $atts&#91;&#039;centermode&#039;] === &#039;1&#039; ? true : false;\n\t\t\t\t$slickSettings&#91;&#039;dots&#039;]           = $atts&#91;&#039;dots&#039;] === &#039;1&#039; ? true : false;\n\t\t\t\t$slickSettings&#91;&#039;infinite&#039;]       = $atts&#91;&#039;infinite&#039;] === &#039;1&#039; ? true : false;\n\t\t\t\t$slickSettings&#91;&#039;slidesToShow&#039;]   = absint( $atts&#91;&#039;slidestoshow&#039;] );\n\t\t\t\t$slickSettings&#91;&#039;slidesToScroll&#039;] = absint( $atts&#91;&#039;slidestoscroll&#039;] );\n\t\t\t\t$slickSettings&#91;&#039;variablewidth&#039;]  = $atts&#91;&#039;variablewidth&#039;] === &#039;1&#039; ? true : false;\n\n\t\t\t\tif ( $atts&#91;&#039;breakpoints&#039;] ) {\n\t\t\t\t    $breakpoints                 = explode( &#039;|&#039;, $atts&#91;&#039;breakpoints&#039;] );\n\t\t\t\t\t$slickSettings&#91;&#039;responsive&#039;] = array();\n\n\t\t\t\t\tforeach ( $breakpoints as $breakpoint ) {\n\t\t\t\t\t    $breakpoint_config = explode( &#039;;&#039;, $breakpoint );\n\t\t\t\t\t    if ( count( $breakpoint_config ) &gt; 2 ) {\n\t\t\t\t\t\t    $slickSettings&#91;&#039;responsive&#039;]&#91;] = array(\n                                &#039;breakpoint&#039; =&gt; absint( $breakpoint_config&#91;0] ),\n                                &#039;settings&#039;   =&gt; array(\n                                    &#039;slidesToShow&#039; =&gt; absint( $breakpoint_config&#91;1] ),\n                                    &#039;slidesToScroll&#039; =&gt; absint( $breakpoint_config&#91;2] ),\n                                )\n                            );\n                        }\n                    }\n                }\n\t\t\t\t\/*$slickSettings&#91;&#039;responsive&#039;] = array(\n                    array(\n                        &#039;breakpoint&#039; =&gt; 600,\n                        &#039;settings&#039;   =&gt; array(\n                            &#039;slidesToShow&#039; =&gt; 2,\n                            &#039;slidesToScroll&#039; =&gt; 2,\n                        )\n                    ),\n\t\t\t\t\tarray(\n\t\t\t\t\t\t&#039;breakpoint&#039; =&gt; 480,\n\t\t\t\t\t\t&#039;settings&#039;   =&gt; array(\n\t\t\t\t\t\t\t&#039;slidesToShow&#039; =&gt; 1,\n\t\t\t\t\t\t\t&#039;slidesToScroll&#039; =&gt; 1,\n\t\t\t\t\t\t)\n\t\t\t\t\t),\n                );*\/\n\t\t\t\t$style&#91;&#039;containerPre&#039;] = &#039;&lt;div id=&quot;wp-sponsors&quot; class=&quot;clearfix slider wp-sponsors &#039; . $atts&#91;&#039;slider_image&#039;] . &#039; &#039; . ( 1 === absint( $atts&#91;&#039;verticalcenter&#039;] ) ? &#039;vertical-center&#039; : &#039;&#039; ) . &#039;&quot; data-slick=&quot;&#039; . esc_attr( wp_json_encode( $slickSettings ) ) . &#039;&quot;&gt;&#039;;\n\t\t\t\t$style&#91;&#039;containerPost&#039;] = &#039;&lt;\/div&gt;&#039;;\n\t\t\t\t$style&#91;&#039;wrapperClass&#039;] = &#039;sponsor-item&#039;;\n\t\t\t\t$style&#91;&#039;wrapperPre&#039;] = &#039;div&#039;;\n\t\t\t\t$style&#91;&#039;wrapperPost&#039;] = &#039;&lt;\/div&gt;&#039;;\n\t\t\t\tbreak;\n\t\t}\n\n\t\tif ( $sponsors ) {\n\t\t\tforeach ( $categories as $category ) {\n\n\t\t\t\tif ( isset( $category&#91;&#039;title&#039;] ) &amp;&amp; $category&#91;&#039;title&#039;] ) {\n\t\t\t\t\techo &#039;&lt;&#039; . $atts&#91;&#039;category_title&#039;] . &#039;&gt;&#039; . $category&#91;&#039;title&#039;] . &#039;&lt;\/&#039; . $atts&#91;&#039;category_title&#039;] . &#039;&gt;&#039;;\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\t$_sponsors = $category&#91;&#039;sponsors&#039;];\n\t\t\t\techo $style&#91;&#039;containerPre&#039;];\n\t\t\t\tforeach ( $_sponsors as $sponsor ) {\n\n\t\t\t\t\t$link        = $sponsor&#91;&#039;link&#039;];\n\t\t\t\t\t$link_target = $sponsor&#91;&#039;link_target&#039;];\n\t\t\t\t\t$target      = 1 === absint( $link_target ) ? &#039;target=&quot;_blank&quot;&#039; : &#039;&#039;;\n\t\t\t\t\t$class       = &#039;&#039;;\n\t\t\t\t\t$class       .= $atts&#91;&#039;size&#039;];\n\n\t\t\t\t\tif ( $sponsor&#91;&#039;categories&#039;] ) {\n\t\t\t\t\t    $class .= &#039; &#039; . implode( &#039; &#039;, wp_list_pluck( $sponsor&#91;&#039;categories&#039;], &#039;slug&#039; ) );\n                    }\n\n\n\t\t\t\t\tif ( $debug ) {\n\t\t\t\t\t\t$class .= &#039; debug&#039;;\n\t\t\t\t\t}\n\n\t\t\t\t\techo &#039;&lt;&#039; . $style&#91;&#039;wrapperPre&#039;] . &#039; class=&quot;&#039; . $style&#91;&#039;wrapperClass&#039;] . &#039; &#039; . $class . &#039;&quot;&gt;&#039;;\n\t\t\t\t\t$sponsor_html = &#039;&#039;;\n\n\t\t\t\t\tif ( $title ) {\n\t\t\t\t\t\t\/\/ Check if we have a link\n\t\t\t\t\t\tif ( $link ) {\n\t\t\t\t\t\t\t$sponsor_html .= &#039;&lt;a href=&#039; . esc_attr( $link ) . &#039; &#039; . $target . &#039; &#039; . ( $nofollow ? &#039;rel=&quot;nofollow&quot;&#039; : &#039;&#039; ) . &#039;&gt;&#039;;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\t$sponsor_html .= &#039;&lt;h3&gt;&#039; . $sponsor&#91;&#039;title&#039;] . &#039;&lt;\/h3&gt;&#039;;\n\t\t\t\t\t\tif ( $link ) {\n\t\t\t\t\t\t\t$sponsor_html .= &#039;&lt;\/a&gt;&#039;;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( $images ) {\n\t\t\t\t\t\t\/\/ Check if we should do images, just show the title if there&#039;s no image set\n\t\t\t\t\t\t$image = $sponsor&#91;&#039;logo&#039;];\n\n\t\t\t\t\t\t\/\/ We did not want title, but we don&#039;t have an image. Show the title then.\n\t\t\t\t\t\tif ( ! $image &amp;&amp; ! $title ) {\n\t\t\t\t\t\t\t$image = &#039;&lt;h3&gt;&#039; . $sponsor&#91;&#039;title&#039;] . &#039;&lt;\/h3&gt;&#039;;\n\t\t\t\t\t\t}\n\n\t\t\t\t\t\tif ( $image ) {\n\t\t\t\t\t\t\t\/\/ Check if we have a link\n\t\t\t\t\t\t\tif ( $link ) {\n\t\t\t\t\t\t\t\t$sponsor_html .= &#039;&lt;a href=&#039; . esc_attr( $link ) . &#039; &#039; . $target . &#039; &#039; . ( $nofollow ? &#039;rel=&quot;nofollow&quot;&#039; : &#039;&#039; ) . &#039;&gt;&#039;;\n\t\t\t\t\t\t\t}\n\n\t\t\t\t\t\t\t$sponsor_html .= $image;\n\n\t\t\t\t\t\t\t\/\/ Close the link tag if we have it\n\t\t\t\t\t\t\tif ( $link ) {\n\t\t\t\t\t\t\t\t$sponsor_html .= &#039;&lt;\/a&gt;&#039;;\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\t\/\/ Check if we need a description and the description is not empty\n\t\t\t\t\tif ( $description ) {\n\t\t\t\t\t\t$desc = $sponsor&#91;&#039;desc&#039;];\n\t\t\t\t\t\tif ( $desc ) {\n\t\t\t\t\t\t\t$sponsor_html .= $desc;\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\n\t\t\t\t\techo $sponsor_html;\n\t\t\t\t\techo $style&#91;&#039;wrapperPost&#039;];\n\n\t\t\t\t}\n\t\t\t\techo $style&#91;&#039;containerPost&#039;];\n\t\t\t}\n\t\t\treturn ob_get_clean();\n\t\t}\n\t}\n                    <\/pre><\/div>\n                    \n                    <p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n                    \n                    \n                    \n                    <pre class=\"wp-block-code\"><code>wp-sponsors\/wp-sponsors\/includes\/class-wp-sponsors-shortcodes.php<\/code><\/pre>\n                    \n            <div style=\"height:50px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n            \n            \n            \n            <h2 class=\"wp-block-heading\">Sponsors [sponsors_acquisition_form] Shortcode<\/h2>\n            \n            \n            \n            <p class=\"wp-block-paragraph\">The WP-Sponsors shortcode creates a form for potential sponsors to submit their details. It includes fields for the sponsor&#8217;s name, email, website, and a description.\n\n\n\nThis form can be customized with additional fields as per requirements, using the &#8216;fields&#8217; and &#8216;fields_labels&#8217; attributes. The form data is handled using the POST method and is secured with a nonce field. \n\nThe shortcode also provides hooks for adding custom actions before the form fields and after the form fields. The form submission is handled by a button with customizable text.<\/p>\n            \n\n            \n            <p class=\"wp-block-paragraph\"><strong>Shortcode<\/strong>: <code>[sponsors_acquisition_form]<\/code><\/p>\n            \n            \n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\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 sponsors_acquisition_form shortcode parameters and attributes:<\/p>\n                \n                \n                <ul>\n<li><code>fields<\/code> &#8211; custom fields to be added in the form<\/li>\n<li><code>fields_labels<\/code> &#8211; labels for the custom fields<\/li>\n<li><code>button<\/code> &#8211; text displayed on the submit button<\/li>\n<\/ul>\n    \n                \n                <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\n                \n                <h3 class=\"wp-block-heading\">Examples and Usage<\/h3>\n                \n \n            <p><strong>Basic example<\/strong> &#8211; A simple shortcode that displays a form for sponsor acquisition with default settings.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors_acquisition_form \/]<\/code><\/pre>\n\n\n<p><strong>Advanced examples<\/strong><\/p>\n\n<p>Adding custom fields to the form using the &#8216;fields&#8217; and &#8216;fields_labels&#8217; attributes. The &#8216;fields&#8217; attribute takes a comma-separated list of field names. The &#8216;fields_labels&#8217; attribute takes a comma-separated list of labels for the fields.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors_acquisition_form fields=\"company,location\" fields_labels=\"Company Name,Location\" \/]<\/code><\/pre>\n\n\n<p>Changing the text of the submit button using the &#8216;button&#8217; attribute.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors_acquisition_form button=\"Send Sponsor Info\" \/]<\/code><\/pre>\n\n\n<p>Combining multiple attributes to customize the form. This example includes custom fields and a custom button text.<\/p>\n\n<pre class=\"wp-block-code\"><code>[sponsors_acquisition_form fields=\"company,location\" fields_labels=\"Company Name,Location\" button=\"Send Sponsor Info\" \/]<\/code><\/pre>\n\n\n            \n            <div style=\"height:5px\" aria-hidden=\"true\" class=\"wp-block-spacer\"><\/div>\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>[sponsors_acquisition_form]<\/code> shortcode, check below the related PHP functions code.<\/p>\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( 'sponsors_acquisition_form', array( __CLASS__, 'sponsors_form' ) );<\/code><\/pre>\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=\"\">\n                    function sponsors_form( $atts = array() ) {\n\t\t$atts = shortcode_atts( array (\n\t\t\t&#039;fields&#039; =&gt; &#039;&#039;,\n\t\t\t&#039;fields_labels&#039; =&gt; &#039;&#039;,\n\t\t\t&#039;button&#039; =&gt; __( &#039;Submit&#039;, &#039;wp-sponsors&#039; ),\n\t\t), $atts, &#039;wp_sponsors_form&#039; );\n\n\n\t\tob_start();\n\t\t?&gt;\n\t\t&lt;form method=&quot;POST&quot; class=&quot;wp-sponsors-form&quot; enctype=&quot;multipart\/form-data&quot;&gt;\n\n\t\t\t&lt;?php\n\t\t\t\tdo_action( &#039;wp_sponsors_acquisition_form_fields_before&#039; );\n\t\t\t\twp_nonce_field( &#039;sponsors_acquisition_form&#039;, &#039;sponsors_acquisition_form_nonce&#039; );\n\t\t\t?&gt;\n\t\t\t&lt;div class=&quot;wp-sponsors-form-field&quot;&gt;\n\t\t\t\t&lt;label for=&quot;wp_sponsors_name&quot;&gt;&lt;?php esc_html_e( &#039;Sponsor Name&#039;, &#039;wp-sponsors&#039; ); ?&gt;&lt;\/label&gt;\n\t\t\t\t&lt;input id=&quot;wp_sponsors_name&quot; required=&quot;required&quot; type=&quot;text&quot; name=&quot;wp_sponsors_form&#91;name]&quot; placeholder=&quot;&lt;?php esc_attr_e( &#039;Sponsor Name&#039;, &#039;wp-sponsors&#039; ); ?&gt;&quot;&gt;\n\t\t\t&lt;\/div&gt;\n\n\t\t\t&lt;div class=&quot;wp-sponsors-form-field&quot;&gt;\n\t\t\t\t&lt;label for=&quot;wp_sponsors_email&quot;&gt;&lt;?php esc_html_e( &#039;Sponsor Email&#039;, &#039;wp-sponsors&#039; ); ?&gt;&lt;\/label&gt;\n\t\t\t\t&lt;input id=&quot;wp_sponsors_email&quot; required=&quot;required&quot; type=&quot;email&quot; name=&quot;wp_sponsors_form&#91;email]&quot; placeholder=&quot;&lt;?php esc_attr_e( &#039;Sponsor Email&#039;, &#039;wp-sponsors&#039; ); ?&gt;&quot;&gt;\n\t\t\t&lt;\/div&gt;\n\n\t\t\t&lt;div class=&quot;wp-sponsors-form-field&quot;&gt;\n\t\t\t\t&lt;label for=&quot;wp_sponsors_website&quot;&gt;&lt;?php esc_html_e( &#039;Sponsor Website&#039;, &#039;wp-sponsors&#039; ); ?&gt;&lt;\/label&gt;\n\t\t\t\t&lt;input id=&quot;wp_sponsors_website&quot; type=&quot;text&quot; name=&quot;wp_sponsors_form&#91;website]&quot; placeholder=&quot;&lt;?php esc_attr_e( &#039;Website&#039;, &#039;wp-sponsors&#039; ); ?&gt;&quot;&gt;\n\t\t\t&lt;\/div&gt;\n\n\t\t\t&lt;div class=&quot;wp-sponsors-form-field&quot;&gt;\n\t\t\t\t&lt;label for=&quot;wp_sponsors_desc&quot;&gt;&lt;?php esc_html_e( &#039;Sponsor Description&#039;, &#039;wp-sponsors&#039; ); ?&gt;&lt;\/label&gt;\n\t\t\t\t&lt;textarea id=&quot;wp_sponsors_desc&quot; name=&quot;wp_sponsors_form&#91;desc]&quot; placeholder=&quot;&lt;?php esc_attr_e( &#039;Description&#039;, &#039;wp-sponsors&#039; ); ?&gt;&quot;&gt;&lt;\/textarea&gt;\n\t\t\t&lt;\/div&gt;\n\n\t\t\t&lt;?php\n\t\t\t\tif ( $atts&#91;&#039;fields&#039;] ) {\n\t\t\t\t\t$fields = explode( &#039;,&#039;, $atts&#91;&#039;fields&#039;] );\n\t\t\t\t\t$labels = explode( &#039;,&#039;, $atts&#91;&#039;fields_labels&#039;] );\n\n\t\t\t\t\tforeach ( $fields as $index =&gt; $field ) {\n\t\t\t\t\t\t$label = isset( $labels&#91; $index ] ) ? $labels&#91; $index ] : ucfirst( $field );\n\t\t\t\t\t\t?&gt;\n\t\t\t\t\t\t&lt;div class=&quot;wp-sponsors-form-field&quot;&gt;\n\t\t\t\t\t\t\t&lt;label for=&quot;wp_sponsors_&lt;?php echo $field; ?&gt;&quot;&gt;&lt;?php echo esc_html( $label ); ?&gt;&lt;\/label&gt;\n\t\t\t\t\t\t\t&lt;textarea id=&quot;wp_sponsors_&lt;?php echo $field; ?&gt;&quot; name=&quot;wp_sponsors_form&#91;&lt;?php echo $field; ?&gt;]&quot; placeholder=&quot;&lt;?php echo esc_attr( $label ); ?&gt;&quot;&gt;&lt;\/textarea&gt;\n\t\t\t\t\t\t&lt;\/div&gt;\n\n\t\t\t\t\t\t&lt;?php\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tdo_action( &#039;wp_sponsors_acquisition_form_fields&#039; );\n\t\t\t?&gt;\n\n\t\t\t&lt;button type=&quot;submit&quot; class=&quot;button wp-sponsors-button&quot; name=&quot;sponsors_acquisition_form&quot;&gt;&lt;?php echo $atts&#91;&#039;button&#039;]; ?&gt;&lt;\/button&gt;\n\t\t&lt;\/form&gt;\n\t\t&lt;?php\n\n\t\treturn ob_get_clean();\n\t}\n                    <\/pre><\/div>\n                    \n                    <p class=\"wp-block-paragraph\"><strong>Code file location<\/strong>:<\/p>\n                    \n                    \n                    \n                    <pre class=\"wp-block-code\"><code>wp-sponsors\/wp-sponsors\/includes\/class-wp-sponsors-shortcodes.php<\/code><\/pre>\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>Sponsors Plugin shortcodes<\/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 Sponsors Shortcodes to your WordPress website, including their parameters, examples, and PHP function code. Additionally, we&#8217;ll assist you with common issues that might cause the Sponsors Plugin shortcodes 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":"Sponsors","slug":"","version":"3.5.0","author":"<a href=\"http:\/\/www.wpsimplesponsorships.com\">Simple Sponsorships<\/a>","icons":"https:\/\/ps.w.org\/wp-sponsors\/assets\/icon-128x128.png?rev=1170378","plugin_tags":"{\"images\":\"images\",\"partners\":\"partners\",\"post-type\":\"post type\",\"sponsors\":\"sponsors\"}","author_profile":"https:\/\/profiles.wordpress.org\/ibenic\/","requires":"3.1.0","tested":"5.7.10","requires_php":"7.0","rating":96,"num_ratings":8,"active_installs":3000,"downloaded":92558,"last_updated":"2021-05-14 9:45pm GMT","added":"2014-12-05","homepage":"http:\/\/www.wpsimplesponsorships.com","short_description":"Sponsors makes it easy to add your sponsors and partners to your WordPress website.","description":"\"Sponsors is a WordPress plugin that allows you to manage and display your site sponsors in an organized and professional manner. Use wp-sponsors to enhance your site's revenue potential.\"","shortcodes":"[\"sponsors\",\"sponsors_acquisition_form\"]","footnotes":""},"categories":[1],"tags":[],"class_list":["post-2076","post","type-post","status-publish","format-standard","hentry","category-plugins"],"_links":{"self":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2076","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=2076"}],"version-history":[{"count":1,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2076\/revisions"}],"predecessor-version":[{"id":2581,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/posts\/2076\/revisions\/2581"}],"wp:attachment":[{"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/media?parent=2076"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/categories?post=2076"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpshortcode.org\/wp-json\/wp\/v2\/tags?post=2076"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}