kalponikoronno

Elementor content template

Nov 1st, 2019
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php
  2.  
  3. protected function _register_controls(){
  4.    
  5.    $this->start_controls_section('content_section', [
  6.       'label' => __('Content', 'hestia-elementor'),
  7.       'tab' => \Elementor\Controls_Manager::TAB_CONTENT
  8.    ]);
  9.    
  10.    $this->add_control('mytitle', [
  11.       'label' => __('My title', 'hestia-elementor'),
  12.       'type' => \Elementor\Controls_Manager::TEXT
  13.    ]);
  14.  
  15.    
  16.    $this->end_controls_section();
  17.    
  18. }
  19.  
  20. protected function render(){
  21.    $settings = $this->get_settings_for_display();
  22.    
  23.    $mytitle = $settings['mytitle'];
  24.  
  25.    echo '<h2 class="myheading">'.esc_html($mytitle).'</h2>';
  26.    
  27. }
  28.  
  29. protected function _content_template(){ ?>
  30.  
  31.    <h2 class="myheading">{{{settings.mytitle}}}</h2>
  32.  
  33. <?php}
Advertisement
Add Comment
Please, Sign In to add comment