hidden.php 948 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. <?php
  2. namespace Elementor;
  3. if ( ! defined( 'ABSPATH' ) ) {
  4. exit; // Exit if accessed directly.
  5. }
  6. /**
  7. * Elementor hidden control.
  8. *
  9. * A base control for creating hidden control. Used to save additional data in
  10. * the database without a visual presentation in the panel.
  11. *
  12. * @since 1.0.0
  13. */
  14. class Control_Hidden extends Base_Data_Control {
  15. /**
  16. * Get hidden control type.
  17. *
  18. * Retrieve the control type, in this case `hidden`.
  19. *
  20. * @since 1.0.0
  21. * @access public
  22. *
  23. * @return string Control type.
  24. */
  25. public function get_type() {
  26. return 'hidden';
  27. }
  28. /**
  29. * Render hidden control output in the editor.
  30. *
  31. * Used to generate the control HTML in the editor using Underscore JS
  32. * template. The variables for the class are available using `data` JS
  33. * object.
  34. *
  35. * @since 1.0.0
  36. * @access public
  37. */
  38. public function content_template() {
  39. ?>
  40. <input type="hidden" data-setting="{{{ data.name }}}" />
  41. <?php
  42. }
  43. }