View Product Page

Affiliate dashboard shortcode

The [yith_wcaf_affiliate_dashboard] shortcode allows you to display the Affiliate dashboard on a custom page of your choice.

The dashboard is divided into different sections and for each of them there’s a specific shortcode available, so you can either display the entire dashboard with all tabs or the content of specific tabs as you wish.

Print specific sections of the affiliate dashboard

With a shortcode for each section, the admin will be able to print that specific affiliate dashboard section on any page of the site.

  • Commissions: [yith_wcaf_show_commissions]
  • Visits: [yith_wcaf_show_clicks]
  • Coupons: [yith_wcaf_show_coupons]
  • Link generator: [yith_wcaf_link_generator]
  • Payments: [yith_wcaf_show_payments]
  • Settings: [yith_wcaf_show_settings]

Each of these shortcodes can have custom settings for the pagination and the menu. You can use the following attributes to configure them:

  • pagination: (yes/no) enable/disable the pagination option for each section. It will show up only if the items are more than the value set in the following attribute per page.
  • per_page: a numeric value that shows the elements per page. Default value is 10.
  • current_page: page number shown in any section.
    Suppose that we have pagination for a list in the “Commissions” section, by specifying 2 as the parameter value, only page 2 will be shown in the section.
  • show_dashboard_links: (yes/no): this allows showing the menu to navigate among the various sections also.

Registration form shortcode

The [yith_wcaf_registration_form] shortcode shows the affilite form, so your users can submit their affiliate appliction from any page of your website.

You can customize the fields of the registration form YITH > Affiliates > General Options > Affiliate Registration as explained here.

If the affiliate has already applied for the affiliate programme, a message will be displayed to inform about the submitted application.

Affiliate registered

The available attributes are:

  • show_login_form: (yes/no) show or hide the login form together with the registration form
  • login_title: you can set here the title of the login form, if displayed
  • register_title: you can set here the title of the register form


[yith_wcaf_registration_form show_login_form="yes" login_title="Log in here" register_title="Apply for our Affiliate Programme"]

Visible content shortcode

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.


[yith_wcaf_show_if_affiliate] This content will only be visible for affiliates [/yith_wcaf_show_if_affiliate]

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.

If you are not an affiliate, you will not be able to see the content.


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.

The attribute is show_to and following are the accepted values:

  • valid_affiliates: shown only to valid affiliates, that is enabled affiliates and hidden to banned ones.
  • enabled_affiliates: shown only to enabled affiliates.
  • all_affiliatesshown to all affiliates.
  • {user role}if you enter a valid user role name, such as shop_manger, the content will be shown just to users with both the shop manager role.
  • logged_in_users: shown only to logged users.
  • anyone: all users.

You can also combine more than one conditions separated by commas and the content will be displayed if at least one of those is true.

Additionally, it is possible to deny one condition by applying an ! before the condition. This could be useful, for example, if you want to show the content to everyone but affiliates.

Example with attribute:

[yith_wcaf_show_if_affiliate show_to="enabled_affiliates"]

[yith_wcaf_show_if_affiliate show_to="all_affiliates"]

“Set Referrer” shortcode

The [yith_wcaf_set_referrer] shortcode inserts a form that gives the user the possibility to enter the affiliate code to whom he/she wants to be associated.

Set referrer shortcode

The only shortcode attribute is affiliate_token which allows you to enter a default affiliation token that will be used in case the customer doesn’t set any referrer.

Current affiliate

The shortcode [yith_wcaf_current_affiliate] allows printing the current affiliate when he/she is in the session.

The shortcode attributes are the following:

  • show_gravatar: (yes/no) shows the affiliate’s gravatar
  • show_real_name: (yes/no) shows the affiliate’s real name
  • show_email: (yes/no) shows the affiliate’s email address
  • no_affiliate_message: shows a message if there is no affiliate in the current session. The default one is “There isn’t any affiliate selected for current session”, but you can customize with your custom text.
Show current affiliate user
Show current affiliate user
No affiliate found for this user
Message for no affiliate found for this user