Welcome to our Knowledge Base
Categories
< All Topics
Print

Button Shortcodes

In the PRO version of WPComplete, the [wpc_button] shortcode can be used in a variety of ways to add, customize, and control completion buttons. These buttons can appear on multiple types of content, and advanced attributes allow for custom text, redirects, caching adjustments, styling, and more.

Adding Multiple Buttons

Several buttons can be placed on the same page by using the name attribute:

[wpc_button name="button-one"]

Displaying Buttons from Another Lesson

To display the button from another lesson, use the post attribute and reference the post ID:

[wpc_button post="345"]

Customizing Button Text

Button text can be changed on a per-button basis (global defaults can also be set in the settings page):

[wpc_button text="Click me to complete!" completed_text="YAY! Completed"]

Caching Considerations

If a caching plugin interferes with shortcodes, add the async attribute to ensure proper updates:

[wpc_button async="true"]

Redirecting After Completion

Buttons can be configured to redirect users to a specific URL after completion. Be sure to include the full https:// in the URL:

[wpc_button redirect="https://wpcomplete.co"]

Filtering by Category or Tag

If lessons are posts or custom post types that use categories and tags, the [wpc_list_pages] shortcode supports filtering.

Category options:

  • cat (int) – category ID
  • category_name (string) – category slug
  • category__and (array) – category IDs
  • category__in (array) – category IDs
  • category__not_in (array) – category IDs

Tag options:

  • tag (string) – tag slug
  • tag_id (int) – tag ID
  • tag__and (array) – tag IDs
  • tag__in (array) – tag IDs
  • tag__not_in (array) – tag IDs
  • tag_slug__and (array) – tag slugs
  • tag_slug__in (array) – tag slugs

Examples:

  • Show all lessons with category "module1": [wpc_list_pages category_name="module1"]
  • Show all lessons with tag "intro": [wpc_list_pages tag="intro"]
  • Show all lessons except those tagged as "intro" with an ID of 34: [wpc_list_pages tag__not_in="34"]

Hidden and Autocomplete Buttons

  • Hidden buttons (not visible to users, but completable via JavaScript): [wpc_button hidden="true"]
  • Auto-complete buttons (complete automatically when the page loads): [wpc_button autocomplete="true"]
  • Hidden + Autocomplete (no visible button, but autocompletes automatically): [wpc_button hidden="true" autocomplete="true"]

Inline Styling

CSS can be applied directly to individual buttons using the style attribute:

[wpc_button style="background: blue;"]

Any valid CSS can be added within the style attribute for one-off customizations.

Conclusion

The [wpc_button] shortcode in WPComplete PRO offers flexibility for course creators to customize how lessons are marked complete. By combining attributes for text, redirects, visibility, caching, and styling, buttons can be tailored to fit the flow and design of any course.

Table of Contents