PluginProbe
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses / 4.1.6.9
LearnPress – WordPress LMS Plugin for Create and Sell Online Courses v4.1.6.9
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-login-form.php

class-lp-shortcode-login-form.php in LearnPress – WordPress LMS Plugin for Create and Sell Online Courses 4.1.6.9, at inc/shortcodes/class-lp-shortcode-login-form.php

49 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Login 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_Login_Form' ) ) {
15 /**
16 * Class LP_Shortcode_Login_Form
17 */
18 class LP_Shortcode_Login_Form extends LP_Abstract_Shortcode {
19 /**
20 * LP_Shortcode_Login_Form constructor.
21 *
22 * @param mixed $atts
23 */
24 public function __construct( $atts = '' ) {
25 parent::__construct( $atts );
26 }
27
28 /**
29 * Shortcode content.
30 *
31 * @return string
32 */
33 public function output() {
34 if ( is_user_logged_in() ) {
35 $user = learn_press_get_current_user();
36 $output = sprintf( __( 'Your are logged in as %1$s. <a href="%2$s">Log out</a>?', 'learnpress' ), $user->get_display_name(), wp_logout_url() );
37 } else {
38 ob_start();
39 learn_press_print_messages();
40 learn_press_get_template( 'global/form-login.php' );
41 $output = ob_get_clean();
42 }
43
44 return $output;
45 }
46
47 }
48 }
49