Thinkific SSO Shortcode

Quick Start Video

To start, you’ll need to ensure you have the following plugins installed and active:

  • Thinkific SSO for WordPress by WooNinja

Top Tip: I recommend you review our installation guide prior to reading this tutorial.

ImportantPlease Read First

  • If you are using a page builder, like Divi, Elementor or similar, the shortcode may not work if you insert it in a text field. This is caused your page builder, not the SSO plugin. Ensure your page builder supports shortcodes prior to purchase and use their dedicated shortcode fields. This also applies to the default WordPress menu.
  • By default, if a student is not logged into your WordPress site, the link generated by our shortcode will simply link to your Thinkfic school. Therefore, it is recommended you only use our shortcode in areas where a user will be logged in e.g. Student dashboard on your WordPress site.
  • For security, Thinkific login links only work for a short period of time once generated. We recommend you do not cache pages that you utilise this shortcode on.
  • Thinkific will create an account for any user that does not have one once they click the link. This extension does not enrol users in a course. You must do this via other means e.g. Our extension for Groundhogg or via Zapier etc.

Basic Usage

You can use our shortcode anywhere in WordPress that shortcodes are permitted. Generally speaking, this is pages, posts and withing certain elements of page builders e.g. Divi, Flatsome etc.

The basic shortcode is:

[thinkific_sso]

This generates a link for the logged-in WordPress user to jump directly into Thinkific, by-passing the login process of Thinkific.

thinkific wordpress basic link 1

Creating a Link

Let’s assume you have a piece of text that you wish to highlight and have linked direct to your Thinkific school. In your post or page builder, you would highlight and it would look similar to this to add a link:

thinkific wp shortcode sso

As you can see, we have highlighted the ‘Click Here’ and added a Thinkfic SSO link via our shortcode. The shortcode you should use in this instance is:

[thinkific_sso prefix=false]

The second parameter, prefix=false, is important as by default, WordPress will add https:// to your links.

Question: How do I redirect to a specific page or website?

Let’s assume when a user logs in, you want to direct them to a specific page or website. This page can be anything you wish, even back to WordPress, but importantly it will log the user into Thinkific as well.

Examples

  • You want to log a user into Thinkific but immediately bring them back to WordPress to view a landing page, terms and conditions or show them content on WordPress.
  • You want to link a user directly into Thinkific and a specific lesson or page.
  • You want to log a user into Thinkific but divert them to a third party site to view content e.g. A video on Vimeo etc.

To do this, you should specify the return_to parameter:

[thinkific_sso return_to=https://www.yoursite.com]

For example, to deep-link into my own Thinkific school, it may look like this:

[thinkific_sso return_to=https://example.thinkific.com/courses/take/my-course/lessons/1234-chapter-two]

Important: Remember to add prefix=false if you are using the shortcode in a place where WordPress will automatically add ‘https://’. See ‘Creating a Link’ above. An example of this form of usage would be:

[thinkific_sso prefix=false return_to=https://example.thinkific.com/courses/take/my-course/lessons/1234-chapter-two]

How do I use the shortcode in PHP code?

You could consider using the shortcode as follows. In this example, we are creating an href link using the SSO URLL

echo '<a href="'.do_shortcode( '[thinkific_sso]' ).'">Click to login!</a>';

Parameters & Advanced Usage

If login fails, or there is an error, you can specify the error url to return to. By default, this is your Thinkific school URL. You can change it with the error_url parameter e.g.

[thinkific_sso error_url=http://www.myschool.com/login-error-page]

The full list of shortcode parameters are:

prefix – Defaults to true. Entering false will remove the http:// or https:// from the start of the Thinkific school URL. This should be used in places where WordPress will automatically add a prefix e.g. Links

base_url – This is the URL of your school and in most instances, this should never change. Defaults to your Thinkific school URL as per your settings.

return_to – This parameter allows you to change where your student is redirected to after login is successful. Defaults to your Thinkfic school URL as per your settings.

error_url – This parameter allows you to redirect a student that fails to log in e.g. Token expired. Defaults to your Thinkific school URL as per your settings.