Shortcodes

Shortcodes

Some shortcodes are offered by the core plugin, Channel Solution for Twitch and others are offered by extensions. Some also require third-party plugins to be installed.

Core Shortcodes

The core plugin was named Channel Solution for Twitch to adhere to WordPress.org terms & conditions. The following shortcodes are available once that plugin is installed, without the need for extensions.

Video List

[twitchpress_videos user_id=""]

This shortcode will list videos but you can also use it to list the links to the videos. There are various parameters and with custom styling, a lot can be achieved with this.

Top (viewed) Games List

[twitchpress_get_top_games_list total="5"]

Generate a simple list of top-viewed games. Control the list size using the “total” value. The default total is ten (remove the value). The generated list is cached for one hour.

Display Channel Status

[twitchpress_channel_status channel_name="ZypheREvolved"]

A simple shortcode for displaying the status of a channel with a single word. You might need to get some help styling the output because it is very basic. You can use channel_name or channel_id but not both. The data is cached so either parameter is fine but providing the correct channel_id initially will reduce the number of requests made to the Twitch API.

Display Channel Status Line

[twitchpress_channel_status_line channel_id=""]

This one displays the channel status with some statistics. All content is added to a single line. You have the option of using channel_id or channel_name for this shortcode.

Channel Status Box

[twitchpress_shortcode_channel_status_box]

Display the status with statistics and all contained within a box (div). Again, the styling is basic and the intention is for you to have it customized to suit your theme. A status box might work well in your sidebar or footer or even just to add some interesting well-placed content to a blog post full of paragraphs.

Services Activation Buttons

[twitchpress_visitor_api_services_buttons]

A list of links (intended to be styled as buttons) for the authorization of third-party services. Use it to create a page for logged-in visitors and allow them to go through the oAuth2 procedures that are available on your site.

Public Sync Buttons

[twitchpress_sync_buttons_public]

This shortcode is intended as a first step towards a more bespoke design. It will output a list of buttons for manual data syncing between WordPress and the selected services API i.e. Twitch.tv and Streamlabs.com, others will be added soon.

Manual syncronizing is really meant as a backup for visitors and as a way to test procedures by developers. The ultimate goal is for everything to happen automatically but I feel there are so many API calls to be made that I cannot rush ahead in this area. So we still need that system for queuing API requests based on priority.

Extension Shortcodes

Remember, extensions are actually plugins. They extend the core plugin and do not work alone. The following shortcodes require the stated extension. If you require a custom version of an extension or just the shortcode, it doesn’t cost a lot.

Embed Live Stream and Chat

[twitchpress_embed_everything channel="ZypheREvolved"]

Extension: TwitchPress Embed Everything

Install the embed-everything extension to display live video content and channel chat as it happens. Parameters include height (pixels) and width (pixels). The early version of this shortcode doesn’t offer all possible parameters but with some updates, there will be more control over the displayed content.

Twitch Login Button

[twitchpress_connect_button]

Extension: TwitchPress Login Extension

Not sure what I used “connect” but we can change that later. This shortcode will display a button that allows login and registration via Twitch. There is an option to automatically register new visitors if their Twitch account is not linked to an existing WordPress user account.

Ultimate Member Role Updater

[twitchpress_update_um_role_button]

Extension: TwitchPress UM Extension

This shortcode outputs a link for use by authenticated WP users. Use the shortcode in posts/views that are restricted until the visitor logs into WP. The intention is for the link to be styled as a button using the theme’s styles. The procedure will check the users Twitch subscription and update their UM role based on the plan. This requires subscription data syncing and so syncing must be active.

Current Users Streamlabs Points

[twitchpress_streamlabs_current_users_points]

Extension: Streamlabs Extension

This one outputs the current logged-in visitors Streamlabs points if they have giving authorization. The user must have authorized the website to access their Streamlabs data. The approach to doing this can be changed per website for a fee but for now there is a simple shortcode that outputs a links. This is shown above on this page.

Advertisements