Last active
September 8, 2022 18:12
-
-
Save anithegregorian/fb16fcb3c7c485b8a6aa6c5a0171ef4e 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 | |
/** | |
* @package elementor-extend.php | |
* @subpackage datdev | |
* @author Exemplifi | |
* @created 29/10/20 - 6:30 PM | |
* @license Creative Commons 3.0 Attribution | |
* @licenseurl https://creativecommons.org/licenses/by/3.0/us/ | |
* @desc Enter description | |
* @link http://www.dat.com | |
*/ | |
if ( ! defined('ABSPATH')) { | |
die(); | |
} | |
include_once(__DIR__ . '/elementor-skins/pricetable-skin.php'); | |
include_once(__DIR__ . '/elementor-skins/tab-skin.php'); | |
include_once(__DIR__ . '/elementor-skins/button-skin.php'); | |
use Elementor\Controls_Manager; | |
use Elementor\Group_Control_Image_Size; | |
use Elementor\Repeater; | |
/** | |
* Injecting custom spacing settings | |
*/ | |
add_action('elementor/element/before_section_end', function ($element, $section_id, $args){ | |
/** @var \Elementor\Element_Base $element */ | |
if ('section' === $element->get_name() && 'section_layout' === $section_id) { | |
$element->start_injection([ | |
'at' => 'after', | |
'of' => 'gap', | |
]); | |
// Add a custom control | |
$element->add_control( | |
'section_vertical_margins', | |
[ | |
'label' => __('Margins', 'dat'), | |
'default' => 'md', | |
'type' => \Elementor\Controls_Manager::SELECT, | |
'options' => [ | |
'default' => __('Default (No Margins)', 'dat'), | |
'xs' => __('Xtra Small', 'dat'), | |
'sm' => __('Small', 'dat'), | |
'md' => __('Medium', 'dat'), | |
'lg' => __('Large', 'dat'), | |
'xl' => __('Xtra Large', 'dat'), | |
], | |
'prefix_class' => 'section-vm-', | |
'description' => __('Section margins will add extra margins at top and bottom of a section, this doesn\'t affect column gaps', 'dat'), | |
] | |
); | |
$element->add_control( | |
'section_vertical_paddings', | |
[ | |
'label' => __('Paddings', 'dat'), | |
'default' => 'default', | |
'type' => \Elementor\Controls_Manager::SELECT, | |
'options' => [ | |
'default' => __('Default (No Paddings)', 'dat'), | |
'xs' => __('Xtra Small', 'dat'), | |
'sm' => __('Small', 'dat'), | |
'md' => __('Medium', 'dat'), | |
'lg' => __('Large', 'dat'), | |
'xl' => __('Xtra Large', 'dat'), | |
], | |
'prefix_class' => 'section-vp-', | |
'description' => __('Section paddings will add extra paddings at top and bottom of a section, this doesn\'t affect column gaps', 'dat'), | |
] | |
); | |
$element->end_injection(); | |
} | |
}, 10, 3); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment