LearnPress Shortcode

Below, you’ll find a detailed guide on how to add the LearnPress – WordPress LMS 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 LearnPress – WordPress LMS Plugin shortcode not to show or not to work correctly.

Before starting, here is an overview of the LearnPress – WordPress LMS Plugin and the shortcodes it provides:

Plugin Icon
LearnPress – WordPress LMS Plugin

"LearnPress – WordPress LMS Plugin is a comprehensive tool designed to create and manage online courses on your WordPress site. This plugin simplifies e-learning process management with ease."

★★★★✩ (534) Active Installs: 90000+ Tested with: 6.3.2 PHP Version: 7.0
Included Shortcodes:
  • [learn_press_become_teacher_form]

LearnPress [learn_press_become_teacher_form] Shortcode

The LearnPress plugin shortcode is designed to render a ‘Become a Teacher’ form on your WordPress site. It fetches settings for display and echoes them out. This shortcode allows customization of the form title, description, and submit button text. It’s a convenient way to invite users to become instructors on your e-learning platform.

Shortcode: [learn_press_become_teacher_form]

Parameters

Here is a list of all possible learn_press_become_teacher_form shortcode parameters and attributes:

  • title – The text displayed as the form’s heading
  • description – The text providing additional details about the form
  • submit_button_text – The text displayed on the form’s submit button
  • submit_button_process_text – The text displayed while the form is processing

Examples and Usage

Basic example – A simple usage of the shortcode to display the teacher registration form with a predefined title, description, and submit button text.

[learn_press_become_teacher_form title="Become a Teacher" description="Register to become a teacher and share your knowledge with our community." submit_button_text="Submit Application"]

For more complex usage, we can also include a custom text that will be displayed while the form is being processed. This is particularly useful for providing feedback to the user after they click the submit button.

Advanced examples – Displaying the teacher registration form with a custom processing text.

[learn_press_become_teacher_form title="Join Our Team" description="Fill the form below to become a part of our teaching staff." submit_button_text="Apply Now" submit_button_process_text="Processing Your Application..."]

In this example, the form will display the title as ‘Join Our Team’, the description as ‘Fill the form below to become a part of our teaching staff.’, and the submit button text as ‘Apply Now’. Once the user clicks the submit button, the text on the button will change to ‘Processing Your Application…’ to indicate that the form is being processed.

PHP Function Code

In case you have difficulties debugging what causing issues with [learn_press_become_teacher_form] shortcode, check below the related PHP functions code.

Shortcode line:

add_shortcode( $this->prefix . $this->shortcode_name, array( $this, 'render' ) );

Shortcode PHP function:

function render() {
		$settings = $this->get_settings_for_display();

		echo do_shortcode( '[learn_press_become_teacher_form title="' . $settings['title'] . '" description="' . $settings['description'] . '" submit_button_text="' . esc_html( $settings['submit_button_text'] ) . '" submit_button_process_text="' . $settings['submit_button_process_text'] . '"]' );
	}

Code file location:

learnpress/learnpress/inc/Shortcodes/AbstractShortcode.php

Conclusion

Now that you’ve learned how to embed the LearnPress – WordPress LMS 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.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *