Skip to content

Instantly share code, notes, and snippets.

@sayedulsayem
Last active October 7, 2021 07:51
Show Gist options
  • Save sayedulsayem/a4995168856076624e31b8cd19106c8a to your computer and use it in GitHub Desktop.
Save sayedulsayem/a4995168856076624e31b8cd19106c8a to your computer and use it in GitHub Desktop.
Elementor group control default value
<?php
$this->add_group_control(
Group_Control_Typography::get_type(),
[
'name' => 'content_typography',
'fields_options' => [
'typography' => [
'default' => 'yes'
],
'font_family' => [
'default' => 'Roboto',
],
'font_weight' => [
'default' => '', // 100, 200, 300, 400, 500, 600, 700, 800, 900, normal, bold
],
'font_size' => [
'default' => [
'unit' => 'px', // px, em, rem, vh
'size' => '', // any number
],
],
'text_transform' => [
'default' => '', // uppercase, lowercase, capitalize, none
],
'font_style' => [
'default' => '', // normal, italic, oblique
],
'text_decoration' => [
'default' => '', // underline, overline, line-through, none
],
'line_height' => [
'default' => [
'unit' => 'px', // px, em
'size' => '', // any number
],
],
'letter_spacing' => [
'default' => [
'unit' => 'px',
'size' => '', // any number
],
],
],
'selector' => '{{WRAPPER}} .class',
]
);
$this->add_group_control(
Group_Control_Box_Shadow::get_type(),
[
'name' => 'box_shadow',
'fields_options' => [
'box_shadow_type' => [
'default' => 'yes', // turn on box shadow by default
],
'box_shadow' => [
'default' => [
'color' => '#000000', // any color code
'horizontal' => '', // any number
'vertical' => '', // any number
'blur' => '', // any number
'spread' => '', // any number
],
],
'box_shadow_position' => [
'default' => '', // '', inset
],
],
'selector' => '{{WRAPPER}} .class',
]
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment