| 1 |
<?php |
| 2 |
/** |
| 3 |
* Elementor Controls for skin Courses Loop Item. |
| 4 |
* |
| 5 |
* @since 4.2.3 |
| 6 |
* @version 1.0.0 |
| 7 |
*/ |
| 8 |
|
| 9 |
use Elementor\Controls_Manager; |
| 10 |
use Thim_EL_Kit\Functions; |
| 11 |
|
| 12 |
/** |
| 13 |
* @var LearnPress\ExternalPlugin\Elementor\Widgets\Course\Skins\CoursesLoopItem $CoursesLoopItem |
| 14 |
*/ |
| 15 |
if ( ! isset( $CoursesLoopItem ) ) { |
| 16 |
return; |
| 17 |
} |
| 18 |
|
| 19 |
if ( ! class_exists( Functions::class ) ) { |
| 20 |
return; |
| 21 |
} |
| 22 |
|
| 23 |
$layout_loop_items = Functions::instance()->get_pages_loop_item( 'lp_course' ); |
| 24 |
|
| 25 |
$CoursesLoopItem->add_control( |
| 26 |
'template_id', |
| 27 |
array( |
| 28 |
'label' => esc_html__( 'Choose a template', 'learnpress' ), |
| 29 |
'type' => Controls_Manager::SELECT2, |
| 30 |
'default' => '0', |
| 31 |
'options' => [ '0' => esc_html__( 'None', 'learnpress' ) ] + $layout_loop_items, |
| 32 |
'prevent_empty' => false, |
| 33 |
) |
| 34 |
); |
| 35 |
|
| 36 |
$CoursesLoopItem->add_responsive_control( |
| 37 |
'columns', |
| 38 |
array( |
| 39 |
'label' => esc_html__( 'Columns', 'learnpress' ), |
| 40 |
'type' => Controls_Manager::NUMBER, |
| 41 |
'default' => 3, |
| 42 |
'min' => 1, |
| 43 |
'selectors' => array( |
| 44 |
'{{WRAPPER}}' => '--lp-el-list-courses-grid-columns: {{VALUE}}', |
| 45 |
), |
| 46 |
) |
| 47 |
); |
| 48 |
|