| 1 |
<?php |
| 2 |
/** |
| 3 |
* Class SingleInstructorElementor |
| 4 |
* |
| 5 |
* @sicne 4.2.3 |
| 6 |
* @version 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
namespace LearnPress\ExternalPlugin\Elementor\Widgets; |
| 10 |
|
| 11 |
use LearnPress\ExternalPlugin\Elementor\LPElementorWidgetBase; |
| 12 |
use LearnPress\Helpers\Config; |
| 13 |
|
| 14 |
class LoginUserFormElementor extends LPElementorWidgetBase { |
| 15 |
public function __construct( $data = [], $args = null ) { |
| 16 |
$this->title = esc_html__( 'Login Form', 'learnpress' ); |
| 17 |
$this->name = 'login_form'; |
| 18 |
$this->keywords = [ 'login' ]; |
| 19 |
$this->icon = 'eicon-lock-user'; |
| 20 |
parent::__construct( $data, $args ); |
| 21 |
} |
| 22 |
|
| 23 |
protected function register_controls() { |
| 24 |
$this->controls = Config::instance()->get( 'login-user-form', 'elementor' ); |
| 25 |
parent::register_controls(); |
| 26 |
} |
| 27 |
|
| 28 |
public function render() { |
| 29 |
try { |
| 30 |
learn_press_show_message(); |
| 31 |
$settings = $this->get_settings_for_display(); |
| 32 |
|
| 33 |
if ( class_exists( '\Elementor\Plugin' ) && \Elementor\Plugin::$instance->editor->is_edit_mode() ) { |
| 34 |
learn_press_get_template( 'global/form-login.php' ); |
| 35 |
} else { |
| 36 |
\LearnPress::instance()->template( 'profile' )->login_form(); |
| 37 |
} |
| 38 |
} catch ( \Throwable $e ) { |
| 39 |
error_log( __METHOD__ . ' ' . $e->getMessage() ); |
| 40 |
} |
| 41 |
} |
| 42 |
|
| 43 |
public function get_style_depends() { |
| 44 |
wp_register_style( 'learnpress', LP_PLUGIN_URL . 'assets/css/learnpress.css', array(), uniqid() ); |
| 45 |
|
| 46 |
return array( 'learnpress' ); |
| 47 |
} |
| 48 |
} |
| 49 |
|