Layers_Customize_Control

The Layers Layers Customize Control class.

Defined (1)

The class is defined in the following location(s).

/core/customizer/controls/base.php  
  1. class Layers_Customize_Control extends WP_Customize_Control { 
  2.  
  3. public $type = ''; 
  4.  
  5. public $label = ''; 
  6.  
  7. public $heading_divider = ''; 
  8.  
  9. public $text = ''; // Used for form elements that have label and text, like Buttons. 
  10.  
  11. public $href = ''; // Buttons href. 
  12.  
  13. public $subtitle = ''; 
  14.  
  15. public $description = ''; 
  16.  
  17. public $linked = ''; 
  18.  
  19. public $class = ''; 
  20.  
  21. public $placeholder = ''; 
  22.  
  23. public $default = NULL; 
  24.  
  25. public $colspan; 
  26.  
  27. public $min; 
  28.  
  29. public $max; 
  30.  
  31. public $step; 
  32.  
  33. /** 
  34. * Render content must be overwrittedn by etending class as this renders the control. 
  35. */ 
  36. public function render_content() {} 
  37.  
  38. /** 
  39. * Get linked data attribute 
  40. * Convert linked array to 'data-' attributes that the js expects. 
  41. * @return string 'data-' attributes. 
  42. */ 
  43. public function get_linked_data() { 
  44.  
  45. if ( 
  46. isset( $this->linked ) && 
  47. is_array( $this->linked ) && 
  48. isset( $this->linked['show-if-selector'] ) && 
  49. isset( $this->linked['show-if-value'] ) 
  50. ) { 
  51.  
  52. $return = ''; 
  53. $return .= 'data-show-if-selector="' . esc_attr( $this->linked['show-if-selector'] ) . '" '; 
  54. $return .= 'data-show-if-value="' . esc_attr( $this->linked['show-if-value'] ) . '" '; 
  55.  
  56. if ( isset( $this->linked['show-if-operator'] ) ) 
  57. $return .= 'data-show-if-operator="' . esc_attr( $this->linked['show-if-operator'] ) . '" '; 
  58.  
  59. return $return; 
  60.  
  61. /** 
  62. Example linked array 
  63. Used when registering a control in config 
  64. 'linked' => array( 
  65. 'show-if-selector' => "#layers-header-layout-fixed",  
  66. 'show-if-value' => "true",  
  67. 'show-if-operator' => "!=",  
  68. */ 
  69.  
  70. /** 
  71. * Get customize data attribute 
  72. * @return array fomratted as the form input needs them; 
  73. */ 
  74. public function get_customize_data() { 
  75.  
  76. $link = explode( '="', $this->get_link() ); 
  77. $link_attr = ltrim( $link[0], 'data-' ); 
  78. $link_val = rtrim( $link[1], '"' ); 
  79. $link_array = array( $link_attr => $link_val ); 
  80.  
  81. return $link_array; 
  82.  
  83. /** 
  84. * Render the Reset-to-Default and possible other history buttons. 
  85. */ 
  86. public function render_history_actions() { 
  87. return false; 
  88. ?> 
  89. <div class="customize-control-history"> 
  90. <!-- <a href="#" class="customize-control-undo fa fa-undo"></a> --> 
  91. <!-- <a href="#" class="customize-control-redo fa fa-repeat"></a> --> 
  92. <a href="#" class="customize-control-default fa fa-refresh" title="<?php _e( 'Reset (cleans the field returning it to original default state)', 'layerswp' ) ?>" data-default="<?php echo esc_attr( $this->default ); ?>"></a> 
  93. </div> 
  94. <?php 
  95.  
  96. /** 
  97. * Render the Reset-to-Default and possible other history buttons. 
  98. */ 
  99. public function render_heading_divider( $text ) { 
  100. ?> 
  101. <span class="customize-control-title layers-heading-divider"> 
  102. <?php echo $text; ?> 
  103. </span> 
  104. <?php 
  105. /** 
  106. ?> 
  107. <table class="layers-heading-divider"> 
  108. <tr> 
  109. <td> 
  110. <span class="customize-control-title"> 
  111. <?php echo $text; ?> 
  112. </span> 
  113. </td> 
  114. <td> 
  115. <div><!----></div> 
  116. </td> 
  117. </tr> 
  118. </table> 
  119. <?php 
  120. */ 
  121.