{"id":330,"date":"2018-07-06T09:09:57","date_gmt":"2018-07-06T09:09:57","guid":{"rendered":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/?p=330"},"modified":"2024-09-10T08:23:06","modified_gmt":"2024-09-10T08:23:06","slug":"visible-content","status":"publish","type":"post","link":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/","title":{"rendered":"Visible content shortcode"},"content":{"rendered":"\n<p>You can use this shortcode to show custom content that has to be visible to the affiliates only. It works like an opening and closing tag set, so the text goes between the tags.<\/p>\n\n\n\n<p>Example:<\/p>\n\n\n\n<p><code>[yith_wcaf_show_if_affiliate]<\/code> This content will only be visible to affiliates <code>[\/yith_wcaf_show_if_affiliate]<\/code> <\/p>\n\n\n\n<p>Or if you use blocks, you can add the opening shortcode in one block, then add a block with your content, and finally add another shortcode block with the closing shortcode. <\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg\" data-rel=\"lightbox-image-0\" data-rl_title=\"\" data-rl_caption=\"\" title=\"\"><img loading=\"lazy\" decoding=\"async\" width=\"2159\" height=\"2136\" src=\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg\" alt=\"\" class=\"wp-image-1357\" srcset=\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg 2159w, https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode-300x297.jpg 300w, https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode-1024x1013.jpg 1024w, https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode-768x760.jpg 768w, https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode-1536x1520.jpg 1536w, https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode-2048x2026.jpg 2048w\" sizes=\"auto, (max-width: 2159px) 100vw, 2159px\" \/><\/a><\/figure>\n\n\n\n<p>If you are not an affiliate, you will not be able to see the content.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Attributes<\/h2>\n\n\n\n<p>The shortcode can also be used for more complex cases, thanks to the included attribute that allows you to show the content to specific affiliates only.<\/p>\n\n\n\n<p>The attribute is&nbsp;<code><strong>show_to<\/strong><\/code> and the following are the accepted values:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong><code>valid_affiliates<\/code>: <\/strong>shown only to valid affiliates, that is enabled affiliates and hidden to banned ones.<\/li>\n\n\n\n<li><strong><code>enabled_affiliates<\/code>: <\/strong>shown only to enabled affiliates.<\/li>\n\n\n\n<li><strong><code>all_affiliates<\/code>:&nbsp;<\/strong>shown to all affiliates.<\/li>\n\n\n\n<li><strong><code>{user role}<\/code>:&nbsp; <\/strong>if you enter a valid user role name, such as <code>shop_manger<\/code>, the content will be shown just to users with both the <em>shop manager<\/em> role.<\/li>\n\n\n\n<li><strong><code>logged_in_users<\/code>: <\/strong>shown&nbsp;only to logged users.<\/li>\n\n\n\n<li><strong><code>anyone<\/code>: <\/strong>all users.<\/li>\n<\/ul>\n\n\n\n<p>You can also combine <strong>more than one conditions<\/strong> separated by commas and the content will be displayed if at least one of those is true.<\/p>\n\n\n\n<p>Additionally, it is possible to <strong>deny one condition<\/strong> by applying a dash (<code><strong>-<\/strong><\/code>) before the condition. This could be useful, for example, if you want to show the content to everyone but affiliates.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\">Example with attribute:<\/h4>\n\n\n\n<p><code>[yith_wcaf_show_if_affiliate show_to=\"enabled_affiliates\"]<\/code><br>CONTENT FOR AFFILIATES ONLY<br><code>[\/yith_wcaf_show_if_affiliate]<\/code><\/p>\n\n\n\n<p><code>[yith_wcaf_show_if_affiliate show_to=\"<strong>-<\/strong>all_affiliates\"]<\/code><br>CONTENT FOR NON-AFFILIATES ONLY<br><code>[\/yith_wcaf_show_if_affiliate]<\/code><\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use this shortcode to show custom content that has to be visible to the affiliates only. It works like an opening and closing tag set, so the text goes between the tags. Example: [yith_wcaf_show_if_affiliate] This content will only be visible to affiliates [\/yith_wcaf_show_if_affiliate] Or if you use blocks, you can add the opening &hellip; <a href=\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/\" class=\"more-link\">Continue reading <span class=\"screen-reader-text\">Visible content shortcode<\/span><\/a><\/p>\n","protected":false},"author":11,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7,11,16],"tags":[],"class_list":["post-330","post","type-post","status-publish","format-standard","hentry","category-premium-version-settings","category-shortcodes","category-shortcodes-free"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.8.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>YITH Affiliates: Visible content shortcode<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"YITH Affiliates: Visible content shortcode\" \/>\n<meta property=\"og:description\" content=\"You can use this shortcode to show custom content that has to be visible to the affiliates only. It works like an opening and closing tag set, so the text goes between the tags. Example: [yith_wcaf_show_if_affiliate] This content will only be visible to affiliates [\/yith_wcaf_show_if_affiliate] Or if you use blocks, you can add the opening &hellip; Continue reading Visible content shortcode\" \/>\n<meta property=\"og:url\" content=\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/\" \/>\n<meta property=\"og:site_name\" content=\"YITH WooCommerce Affiliates\" \/>\n<meta property=\"article:published_time\" content=\"2018-07-06T09:09:57+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-09-10T08:23:06+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/\",\"url\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/\",\"name\":\"YITH Affiliates: Visible content shortcode\",\"isPartOf\":{\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg\",\"datePublished\":\"2018-07-06T09:09:57+00:00\",\"dateModified\":\"2024-09-10T08:23:06+00:00\",\"author\":{\"@id\":\"\"},\"breadcrumb\":{\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#primaryimage\",\"url\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg\",\"contentUrl\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg\",\"width\":2159,\"height\":2136},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Visible content shortcode\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/#website\",\"url\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/\",\"name\":\"YITH WooCommerce Affiliates\",\"description\":\"Plugin documentation\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"\",\"url\":\"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/author\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"YITH Affiliates: Visible content shortcode","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/","og_locale":"en_US","og_type":"article","og_title":"YITH Affiliates: Visible content shortcode","og_description":"You can use this shortcode to show custom content that has to be visible to the affiliates only. It works like an opening and closing tag set, so the text goes between the tags. Example: [yith_wcaf_show_if_affiliate] This content will only be visible to affiliates [\/yith_wcaf_show_if_affiliate] Or if you use blocks, you can add the opening &hellip; Continue reading Visible content shortcode","og_url":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/","og_site_name":"YITH WooCommerce Affiliates","article_published_time":"2018-07-06T09:09:57+00:00","article_modified_time":"2024-09-10T08:23:06+00:00","og_image":[{"url":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg","type":"","width":"","height":""}],"twitter_card":"summary_large_image","twitter_misc":{"Written by":"","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/","url":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/","name":"YITH Affiliates: Visible content shortcode","isPartOf":{"@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/#website"},"primaryImageOfPage":{"@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#primaryimage"},"image":{"@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#primaryimage"},"thumbnailUrl":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg","datePublished":"2018-07-06T09:09:57+00:00","dateModified":"2024-09-10T08:23:06+00:00","author":{"@id":""},"breadcrumb":{"@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#primaryimage","url":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg","contentUrl":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-content\/uploads\/sites\/272\/2022\/03\/Visible-content-shortcode.jpg","width":2159,"height":2136},{"@type":"BreadcrumbList","@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/premium-version-settings\/visible-content\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/"},{"@type":"ListItem","position":2,"name":"Visible content shortcode"}]},{"@type":"WebSite","@id":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/#website","url":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/","name":"YITH WooCommerce Affiliates","description":"Plugin documentation","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"","url":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/author\/"}]}},"_links":{"self":[{"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/posts\/330","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/users\/11"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/comments?post=330"}],"version-history":[{"count":26,"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/posts\/330\/revisions"}],"predecessor-version":[{"id":2369,"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/posts\/330\/revisions\/2369"}],"wp:attachment":[{"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/media?parent=330"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/categories?post=330"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.yithemes.com\/yith-woocommerce-affiliates\/wp-json\/wp\/v2\/tags?post=330"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}