wp-widget.php 1.3 KB

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