Skip to content

Instantly share code, notes, and snippets.

@asifpix
Created November 11, 2019 17:39
Show Gist options
  • Save asifpix/87426718e56c6452f99182287a2679f9 to your computer and use it in GitHub Desktop.
Save asifpix/87426718e56c6452f99182287a2679f9 to your computer and use it in GitHub Desktop.
<?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() {}
}
@masumskaib396
Copy link

asif vai plugin ta upload koren

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment