Created
November 11, 2019 17:39
-
-
Save asifpix/87426718e56c6452f99182287a2679f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Travelux_Terms extends \Elementor\Widget_Base { | |
use Term_Controls; | |
public function get_name() { | |
return 'travelux_terms'; | |
} | |
public function get_title() { | |
return __( 'Terms', 'travelux-core' ); | |
} | |
public function get_icon() { | |
return 'fas fa-home'; | |
} | |
public function get_categories() { | |
return ['travelux']; | |
} | |
protected function _register_controls() { | |
$this->start_controls_section( | |
'taxonomy_content_section', | |
[ | |
'label' => __( 'Content', 'plugin-name' ), | |
'tab' => \Elementor\Controls_Manager::TAB_CONTENT, | |
] | |
); | |
$this->add_control( | |
'travelux_taxonomy', | |
[ | |
'label' => __( 'Select a taxonomy', 'plugin-domain' ), | |
'type' => \Elementor\Controls_Manager::SELECT, | |
'default' => array_keys($this->getTaxonomies())[0], | |
'options' => $this->getTaxonomies(), | |
] | |
); | |
$some = $this->get_settings('travelux_taxonomy'); | |
$terms = get_terms( $some ); | |
$term_list = wp_list_pluck( $terms, 'name', 'term_id' ); | |
$this->add_control( | |
'show_terms', | |
[ | |
'label' => __( 'Show Terms', 'plugin-domain' ), | |
'type' => \Elementor\Controls_Manager::SELECT2, | |
'multiple' => true, | |
'options' => $term_list, | |
] | |
); | |
$this->end_controls_section(); | |
} | |
protected function render() {} | |
protected function _content_template() {} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
asif vai plugin ta upload koren