← All changes
|
inc/Shortcodes/class-lp-shortcode-register-form.php
+49
-49
4.3.9
→
4.4.8
View file →
| @@ -1,49 +1,49 @@ | ||
| 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 | -} | |
| 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 | +} | |