wp-widget.php (1378B)
1 <?php 2 namespace Elementor; 3 4 if ( ! defined( 'ABSPATH' ) ) { 5 exit; // Exit if accessed directly. 6 } 7 8 /** 9 * Elementor WordPress widget control. 10 * 11 * A base control for creating WordPress widget control. Displays native 12 * WordPress widgets. This a private control for internal use. 13 * 14 * @since 1.0.0 15 */ 16 class Control_WP_Widget extends Base_Data_Control { 17 18 /** 19 * Get WordPress widget control type. 20 * 21 * Retrieve the control type, in this case `wp_widget`. 22 * 23 * @since 1.0.0 24 * @access public 25 * 26 * @return string Control type. 27 */ 28 public function get_type() { 29 return 'wp_widget'; 30 } 31 32 /** 33 * Get WordPress widget control default values. 34 * 35 * Retrieve the default value of the WordPress widget control. Used to return the 36 * default values while initializing the WordPress widget control. 37 * 38 * @since 1.4.3 39 * @access public 40 * 41 * @return array Control default value. 42 */ 43 public function get_default_value() { 44 return []; 45 } 46 47 /** 48 * Render WordPress widget control output in the editor. 49 * 50 * Used to generate the control HTML in the editor using Underscore JS 51 * template. The variables for the class are available using `data` JS 52 * object. 53 * 54 * @since 1.0.0 55 * @access public 56 */ 57 public function content_template() { 58 ?> 59 <form action="" method="post"> 60 <div class="wp-widget-form-loading">Loading..</div> 61 </form> 62 <?php 63 } 64 }