PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.4.2
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.4.2
4.4.8 4.4.7 4.4.6 4.4.5 4.4.4 4.4.3 4.4.2 4.4.1 4.4.0 4.3.9.1 4.3.9 4.3.8 4.3.7 4.1.6.9 4.1.6.9.1 4.1.6.9.2 4.1.6.9.3 4.1.6.9.4 4.1.7 4.1.7.1 4.1.7.2 4.1.7.3 4.1.7.3.1 4.1.7.3.2 4.2.0 All 139 releases
learnpress / inc / Shortcodes / class-lp-shortcode-register-form.php

class-lp-shortcode-register-form.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.4.2, at inc/Shortcodes/class-lp-shortcode-register-form.php

50 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Register Form Shortcode.
4 *
5 * @author ThimPress
6 * @category Shortcodes
7 * @package Learnpress/Shortcodes
8 * @version 3.0.0
9 * @extends LP_Abstract_Shortcode
10 */
11
12 defined( 'ABSPATH' ) || exit();
13
14 if ( ! class_exists( 'LP_Shortcode_Register_Form' ) ) {
15
16 /**
17 * Class LP_Shortcode_Register_Form
18 */
19 class LP_Shortcode_Register_Form extends LP_Abstract_Shortcode {
20 /**
21 * LP_Shortcode_Register_Form constructor.
22 *
23 * @param mixed $atts
24 */
25 public function __construct( $atts = '' ) {
26 parent::__construct( $atts );
27 }
28
29 /**
30 * Shortcode content.
31 *
32 * @return string
33 */
34 public function output() {
35 wp_enqueue_style( 'learnpress' );
36 if ( is_user_logged_in() ) {
37 $user = learn_press_get_current_user();
38 $output = sprintf( __( 'Your are logged in as %1$s. <a href="%2$s">Log out</a>?', 'learnpress' ), $user->get_display_name(), wp_logout_url() );
39 } else {
40 ob_start();
41 learn_press_show_message();
42 learn_press_get_template( 'global/form-register.php' );
43 $output = ob_get_clean();
44 }
45
46 return $output;
47 }
48 }
49 }
50