| 1 |
<?php |
| 2 |
/** |
| 3 |
* Elementor widget: Login link (for headers generally) |
| 4 |
* |
| 5 |
* Created Date: Wednesday September 2nd 2020 |
| 6 |
* Author: Michael Bourne |
| 7 |
* ----- |
| 8 |
* Last Modified: Thursday, January 9th 2025, 1:50:44 pm |
| 9 |
* Modified By: Michael Bourne |
| 10 |
* ----- |
| 11 |
* Copyright (c) 2020 URSA6 |
| 12 |
* |
| 13 |
* @package wp-commerce7 |
| 14 |
* @author Michael Bourne |
| 15 |
* @license GPL3 |
| 16 |
* @link https://ursa6.com |
| 17 |
* @since 1.0.8 |
| 18 |
*/ |
| 19 |
|
| 20 |
if ( ! defined( 'ABSPATH' ) ) { |
| 21 |
return; |
| 22 |
} |
| 23 |
|
| 24 |
/** |
| 25 |
* Widget class |
| 26 |
*/ |
| 27 |
class C7WP_Elementor_Login extends \Elementor\Widget_Base { |
| 28 |
|
| 29 |
|
| 30 |
/** |
| 31 |
* Get widget name. |
| 32 |
* |
| 33 |
* Retrieve Commerce7 widget name. |
| 34 |
* |
| 35 |
* @since 1.0.0 |
| 36 |
* @access public |
| 37 |
* |
| 38 |
* @return string Widget name. |
| 39 |
*/ |
| 40 |
public function get_name() { |
| 41 |
return 'commerce7-login'; |
| 42 |
} |
| 43 |
|
| 44 |
/** |
| 45 |
* Get widget title. |
| 46 |
* |
| 47 |
* Retrieve Commerce7 widget title. |
| 48 |
* |
| 49 |
* @since 1.0.0 |
| 50 |
* @access public |
| 51 |
* |
| 52 |
* @return string Widget title. |
| 53 |
*/ |
| 54 |
public function get_title() { |
| 55 |
return __( 'Login Link', 'wp-commerce7' ); |
| 56 |
} |
| 57 |
|
| 58 |
/** |
| 59 |
* Get widget icon. |
| 60 |
* |
| 61 |
* Retrieve Commerce7 widget icon. |
| 62 |
* |
| 63 |
* @since 1.0.0 |
| 64 |
* @access public |
| 65 |
* |
| 66 |
* @return string Widget icon. |
| 67 |
*/ |
| 68 |
public function get_icon() { |
| 69 |
return 'c7icon-c7sm'; |
| 70 |
} |
| 71 |
|
| 72 |
/** |
| 73 |
* Get widget categories. |
| 74 |
* |
| 75 |
* Retrieve the list of categories the widget belongs to. |
| 76 |
* |
| 77 |
* @since 1.0.0 |
| 78 |
* @access public |
| 79 |
* |
| 80 |
* @return array Widget categories. |
| 81 |
*/ |
| 82 |
public function get_categories() { |
| 83 |
return [ 'commerce7' ]; |
| 84 |
} |
| 85 |
|
| 86 |
/** |
| 87 |
* Retrieve widget keywords. |
| 88 |
* |
| 89 |
* @since 1.0.0 |
| 90 |
* @access public |
| 91 |
* |
| 92 |
* @return array Widget keywords. |
| 93 |
*/ |
| 94 |
public function get_keywords() { |
| 95 |
return [ 'commerce7', 'login' ]; |
| 96 |
} |
| 97 |
|
| 98 |
/** |
| 99 |
* Register widget controls. |
| 100 |
* |
| 101 |
* Adds different input fields to allow the user to change and customize the widget settings. |
| 102 |
* |
| 103 |
* @since 1.0.0 |
| 104 |
* @access protected |
| 105 |
*/ |
| 106 |
protected function register_controls() { } // phpcs:ignore |
| 107 |
|
| 108 |
/** |
| 109 |
* Render Commerce widget output on the frontend. |
| 110 |
* |
| 111 |
* Written in PHP and used to generate the final HTML. |
| 112 |
* |
| 113 |
* @since 1.0.0 |
| 114 |
* @access protected |
| 115 |
*/ |
| 116 |
protected function render() { |
| 117 |
|
| 118 |
echo do_shortcode( '[c7wp type="login"]' ); |
| 119 |
|
| 120 |
} |
| 121 |
|
| 122 |
protected function content_template() {} //phpcs:ignore |
| 123 |
public function render_plain_content( $instance = [] ) {} |
| 124 |
|
| 125 |
} |