Below, you’ll find a detailed guide on how to add the Wheel Of Life Shortcode to your WordPress website, including its parameters, examples, and PHP function code. Additionally, we’ll assist you with common issues that might cause the Wheel Of Life Plugin shortcode not to show or not to work correctly.
Before starting, here is an overview of the Wheel Of Life Plugin and the shortcodes it provides:
"Wheel of Life: Coaching and Assessment Tool for Life Coach is a dynamic WordPress plugin designed for life coaches. It offers interactive assessments and valuable insights to aid personal growth."
- [wheeloflife]
Wheel Of Life [wheeloflife] Shortcode
The Wheel-of-Life shortcode is a customizable function that renders a user-interactive form. It initiates an assessment when the ‘Start Assessment’ label is clicked. The attributes ‘id’, ‘label’, ‘popup_label’, and ‘mode’ can be customized to suit your needs. The ‘mode’ attribute determines how the form appears, either as a popup or embedded within the page. Shortcode: [wheeloflife_form_render]
Shortcode: [wheeloflife]
Parameters
Here is a list of all possible wheeloflife shortcode parameters and attributes:
id
– The unique identifier for the specific wheel of life assessment.label
– The text displayed on the start button of the assessment.popup_label
– The text shown on the popup when the assessment starts.mode
– Determines how the assessment will be displayed, either as a popup or embedded.
Examples and Usage
Basic example – Displaying the Wheel of Life form with default settings.
[wheeloflife /]
In this basic example, the Wheel of Life form will be displayed with default settings. No additional parameters are specified, so the form will use the default labels and mode.
Advanced examples
Displaying the Wheel of Life form with a specific ID and custom labels.
[wheeloflife id="2" label="Begin Your Journey" popup_label="Begin Your Journey Here" /]
In this advanced example, the Wheel of Life form is displayed with a specific ID. The labels for the form and the popup are also customized. The ID parameter allows you to choose a specific form, while the label parameters allow you to customize the text displayed on the form and popup.
Displaying the Wheel of Life form with a specific ID, custom labels, and in ‘inline’ mode.
[wheeloflife id="3" label="Start Your Assessment" popup_label="Start Your Assessment Here" mode="inline" /]
In this more advanced example, the Wheel of Life form is displayed with a specific ID, custom labels, and in ‘inline’ mode. The ‘inline’ mode means that the form will be displayed directly on the page, rather than in a popup.
PHP Function Code
In case you have difficulties debugging what causing issues with [wheeloflife]
shortcode, check below the related PHP functions code.
Shortcode line:
add_shortcode( 'wheeloflife', array( $this, 'wheeloflife_form_render' ) );
Shortcode PHP function:
function wheeloflife_form_render( $atts = array() ) {
$atts = array_change_key_case( (array) $atts, CASE_LOWER );
// override default attributes with user attributes
$wheeloflife_atts = shortcode_atts(
array(
'id' => '',
'label' => __( 'Start Assessment', 'wheel-of-life' ),
'popup_label' => __( 'Start Assessment', 'wheel-of-life' ),
'mode' => 'popup',
),
$atts
);
ob_start();
echo '<div class="wheelOfLifeRootAppSelector" data-mode=' . esc_attr( $wheeloflife_atts['mode'] ) . ' data-wheel-id=' . esc_attr( $wheeloflife_atts['id'] ) . ' data-btn-label="' . esc_attr( $wheeloflife_atts['label'] ) . '" data-popup-lbl="' . esc_attr( $wheeloflife_atts['popup_label'] ) . '"></div>';
return ob_get_clean();
}
Code file location:
wheel-of-life/wheel-of-life/includes/Wheel_Of_Life_Admin.php
Conclusion
Now that you’ve learned how to embed the Wheel Of Life Plugin shortcode, understood the parameters, and seen code examples, it’s easy to use and debug any issue that might cause it to ‘not work’. If you still have difficulties with it, don’t hesitate to leave a comment below.
Leave a Reply