To get your AudiencePlayer integration up to speed, customised Wordpress shortcodes are available for the most important features (see overview below). Style, layout and business logic contained in these shortcodes can easily be overwritten, or simply used as a development template for your own customised integration (in which case, please also see the help section {{SECTION_HELP_TAB_CODE_EXAMPLES_TITLE}}).
To overwrite, simply copy the relevant file(s) into a matching folder/file structure in your active "theme" folder.
The plugin will first look here for the relevant files, and fallback to its own templates.
For example, copy the file: /wp-content/plugins/audienceplayer/templates/audienceplayer-shortcode-article-detail.php
to:
/wp-content/themes/twentytwenty/audienceplayer/templates/audienceplayer-shortcode-article-detail.php
and modify it there to suit your requirements.
Location of the plugin template files:
/wp-content/plugins/audienceplayer/templates/audienceplayer-shortcode-*.php # location of the main php/html shortcode template files /wp-content/plugins/audienceplayer/templates/audienceplayer-generic-*.php # location of the main php/html generic page template files # e.g. for generic video detail pages /wp-content/plugins/audienceplayer/templates/js/audienceplayer-shortcodes.js # location of the main javascript business logic /wp-content/plugins/audienceplayer/templates/css/audienceplayer-shortcodes.css # location of the css style file /wp-content/plugins/audienceplayer/templates/images # location of image placeholders
Important notes:
[audienceplayer_article_carousel category_id=123 # Display articles in category. ancestor_id=456 # Display child articles of ancestor. aspect_ratio="16x9" # Image aspect ratio (landscape "16x9" or portrait "2x3"). show_titles=true # Display titles below the images. click_action="" # Your own custom deeplink pattern, e.g. "/articles/{{ancestor_id}}/{{article_id}}". # available variables: [ancestor_id, article_id, category_id, asset_id, article_url_slug, # ancestor_url_slug, category_url_slug, article_type_base_url_slug, article_series_base_url_slug, locale]. # if a full url or relative path (beginning with "/") is provided, action will redirect user, # else given click_action will be assumed to be a callback function. # special values: 1) "modal": playback on modal player, 2) "auto": auto-generate detail page. # pattern used by value "default": # > episodes: /{{article_series_base_url_slug}}/{{ancestor_url_slug}}/{{article_type_base_url_slug}}/{{article_url_slug}}}/ # > all others: /{{article_type_base_url_slug}}/{{article_url_slug}}}/ click_action_path_prefix="" # Allows for a custom path prefix, e.g. a value "en" is beneficial to prefix with a specific language locale: "/en/...". # the click action will always be prefixed with this argument when set. # Optionally the value "{{locale}}" may be used, so that the shortcode will take care of # prefixing the correct locale by internally calling: # `$AudiencePlayerWordpressPlugin->helper()->getLocale();` authentication_action="" # Comparable to "click_action", this is executed when a user is not logged in and tries to # view content. (by default, user is redirect to "wp-login?redirect_to=current_url"). authorisation_action="" # Comparable to "click_action", this is executed when a user is not authorised to view # content. (by default, a modal error dialog "payment required" is shown). class="" # your own custom class name, which is applied to the root container element. ]
[audienceplayer_article_grid category_id=123 # Display articles in category. ancestor_id=456 # Display child articles of ancestor. limit=0 # Pagination limit offset=0 # Pagination offset show_pagination=true # Show pagination bullets, only applies when a limit has been specified. aspect_ratio="16x9" # Image aspect ratio (landscape "16x9" or portrait "2x3"). show_titles=true # Display titles below the images. click_action="" # Your own custom deeplink pattern, e.g. "/articles/{{ancestor_id}}/{{article_id}}". # Available variables: [ancestor_id, article_id, category_id, asset_id, article_url_slug, # ancestor_url_slug, category_url_slug]. # If a full url or relative path (beginning with "/") is provided, action will redirect user, # else given click_action will be assumed to be a callback function. # Special values: 1) "modal": playback on modal player, 2) "auto": auto-generate detail page. authentication_action="" # Comparable to "click_action", this is executed when a user is not logged in and tries to # view content. (by default, user is redirect to "wp-login?redirect_to=current_url"). authorisation_action="" # Comparable to "click_action", this is executed when a user is not authorised to view # content. (by default, a modal error dialog "payment required" is shown). class="" # your own custom class name, which is applied to the root container element. ]
[audienceplayer_play_article_button article_id=123 # The article id which contains the asset. asset_id=456 # The asset_id to be played. label="Afspelen" # The text label that will appear in the button. authentication_action="" # Comparable to "click_action", this is executed when a user is not logged in and tries to # view content. (by default, user is redirect to "wp-login?redirect_to=current_url") authorisation_action="" # Comparable to "click_action", this is executed when a user is not authorised to view # content. (by default, a modal error dialog "payment required" is shown). class="" # Your own custom class name, which is applied to the root container element. ]
[audienceplayer_embed_article article_id=123 # The article id which contains the asset. asset_id=456 # The asset_id to be played. height=384 # Height of the embedded player. width=216 # Width of the embedded player. autoplay=false # Automatically start playback (IF the browser allows this. E.g. Safari does not). poster_image_url="" # Image url of poster to be placed in the background. label="Play video" # The text label that will appear in the button. class="" # Your own custom class name, which is applied to the root container element. ]
[audienceplayer_purchase_product_button product_id=123 # The product id of the product. label="Buy product" # The text label that will appear in the button, with fallbacks to 1. "Article.call_to_action_tag" # (optionally defined in AudiencePlayer CMS) and 2. the translation "button_purchase_product" (see # template "audienceplayer-core-translations.php"). show_voucher_validation=true # Show voucher validation in the modal dialog flow. authentication_action="" # Comparable to "click_action", this is executed when a user is not logged in and tries to # view content. (by default, user is redirect to "wp-login?redirect_to=current_url"). # The additional parameter "purchase_product_id" ensures the purchase modal is reopened on return. authorisation_action="" # Comparable to "click_action", this is executed when a user is not authorised to view # content. (by default, a modal error dialog "payment required" is shown). after_purchase_action="" # Comparable to "click_action", this is executed after a user has successfully paid with # the remote payment provider and returned to the page. class="" # Your own custom class name, which is applied to the root container element. ]
[audienceplayer_purchase_subscriptions subscription_ids=1,2,3 # Specify the subscriptions to be shown (by default, all are shown). recommended_subscription_id=2 # The recommended subscription id will be highlighted with a "popular choice" ribbon. recommended_subscription_label="" # The text shown in the "popular choice" ribbon. label="Buy product" # The text label that will appear in the buttons, with fallback to the translation # "button_select_subscription" (see template "audienceplayer-core-translations.php"). show_voucher_validation=true # Show voucher validation in the modal dialog flow. show_description=true # Show the subscription description. authentication_action="" # Comparable to "click_action", this is executed when a user is not logged in and tries to # view content. (by default, user is redirect to "wp-login?redirect_to=current_url"). # The additional parameter "purchase_subscription_id" ensures the purchase modal is reopened on return. authorisation_action="" # Comparable to "click_action", this is executed when a user is not authorised to view # content. (by default, a modal error dialog "payment required" is shown). after_purchase_action="" # Comparable to "click_action", this is executed after a user has successfully paid with # the remote payment provider and returned to the page. class="" # Your own custom class name, which is applied to the root container element. ]
[audienceplayer_article_detail article_id=123 # The article id for which details will be displayed. meta_keys="year,parental" # Comma separated list of metadata keys to be displayed. show_trailer=true # Show play-button for trailer (if available). show_products=true # Show purchase-button(s) for related products. show_description=true # Show the article description. show_descendant_articles=true # Show descendant articles, applicable when given article_id is a series with seasons # and/or episodes. authentication_action="" # Comparable to "click_action", this is executed when a user is not logged in and tries to # view content (by default, user is redirect to "wp-login?redirect_to=current_url"). authorisation_action="" # Comparable to "click_action", this is executed when a user is not authorised to view # content. (by default, a modal error dialog "payment required" is shown). class="" # Your own custom class name, which is applied to the root container element. ]
[audienceplayer_user_account show_subscription_info=true # Display subscription information. show_subscription_suspend=true # Display subscription (un)suspend toggle. show_notifiable=false # Display SMS/text-notification toggle (only applicable for some projects). show_voucher_redeem=true # Display voucher redemption. show_payment_method=true # Display payment method details. show_payment_orders=true # Display payment order list. class="" # Your own custom class name, which is applied to the root container element. ]
[audienceplayer_device_pairing show_claim_device=true # Display form to claim a pairing code for a new device. show_user_devices=true # Display list of already paired devices. class="" # Your own custom class name, which is applied to the root container element. ]