';
}
}
if ( !function_exists('lte_elementor_responsive_options') ) {
function lte_elementor_responsive_options($options = null) {
$controls = [];
if ( empty($options) ) {
$options[1] = 1;
}
$swiper_items = [
'xl' => [ esc_html__( 'Extra Large Desktop, 1600px', 'tofit' ), 4],
'lg' => [ esc_html__( 'Large Desktop, 1200px,', 'tofit' ), 4],
'md' => [ esc_html__( 'Notebook, 1000px', 'tofit' ), 4],
'sm' => [ esc_html__( 'Tablet, 768px', 'tofit' ), 3],
'ms' => [ esc_html__( 'Horizontal Mobile, 480px', 'tofit' ), 3],
'xs' => [ esc_html__( 'Mobile', 'tofit' ), 1],
];
foreach ( $swiper_items as $bp => $item ) {
$controls['columns_' . $bp] =
[
'label' => $item[0],
'type' => 'Controls_Manager::SELECT',
'label_block' => true,
'default' => $item[1],
'options' => $options,
];
}
return $controls;
}
}
if ( !function_exists('lte_responsive_cols') ) {
function lte_responsive_cols($config = null) {
$options = lte_elementor_responsive_options();
$class = [];
foreach ( $options as $key => $val ) {
$opt = (int)(12 / $config[$key]);
if ( $config[$key] == 5 ) $opt = 5;
$class[] = 'col-'.str_replace('columns_', '', $key).'-'.$opt;
}
return $class;
}
}
/**
* Display section edit link in preview mode
* in progress
*/
if ( !function_exists( 'lte_filter_section' ) ) {
function lte_section_link( $content, $section_id ) {
$out = '';
if ( isset($_GET['elementor-preview']) AND $_GET['elementor-preview'] != $section_id ) {
/*
$out .= '
';
*/
}
return $content . $out;
}
add_filter( 'lte_filter_section', 'lte_section_link', 10, 3 );
}
if ( !function_exists( 'lte_elementor_admin_bar_list' ) ) {
function lte_elementor_admin_bar_list( $settings ) {
foreach ( $settings['elementor_edit_page']['children'] as $pid => &$item ) {
if ( $item['sub_title'] == 'Post' ) {
$item['sub_title'] = ucfirst(get_post_type($pid));
}
}
return $settings;
}
}
add_filter( 'elementor/frontend/admin_bar/settings', 'lte_elementor_admin_bar_list' );
/*
add_action('elementor/editor/before_enqueue_scripts', function () {
echo "";
});
*/