background.php
1 year ago
base.php
3 years ago
border.php
2 years ago
box-shadow.php
2 years ago
css-filter.php
2 years ago
flex-container.php
1 year ago
flex-item.php
2 years ago
grid-container.php
1 year ago
image-size.php
2 years ago
text-shadow.php
2 years ago
text-stroke.php
2 years ago
typography.php
1 year ago
text-shadow.php
95 lines
| 1 | <?php |
| 2 | namespace Elementor; |
| 3 | |
| 4 | if ( ! defined( 'ABSPATH' ) ) { |
| 5 | exit; // Exit if accessed directly. |
| 6 | } |
| 7 | |
| 8 | /** |
| 9 | * Elementor text shadow control. |
| 10 | * |
| 11 | * A base control for creating text shadow control. Displays input fields to define |
| 12 | * the text shadow including the horizontal shadow, vertical shadow, shadow blur and |
| 13 | * shadow color. |
| 14 | * |
| 15 | * @since 1.6.0 |
| 16 | */ |
| 17 | class Group_Control_Text_Shadow extends Group_Control_Base { |
| 18 | |
| 19 | /** |
| 20 | * Fields. |
| 21 | * |
| 22 | * Holds all the text shadow control fields. |
| 23 | * |
| 24 | * @since 1.6.0 |
| 25 | * @access protected |
| 26 | * @static |
| 27 | * |
| 28 | * @var array Text shadow control fields. |
| 29 | */ |
| 30 | protected static $fields; |
| 31 | |
| 32 | /** |
| 33 | * Get text shadow control type. |
| 34 | * |
| 35 | * Retrieve the control type, in this case `text-shadow`. |
| 36 | * |
| 37 | * @since 1.6.0 |
| 38 | * @access public |
| 39 | * @static |
| 40 | * |
| 41 | * @return string Control type. |
| 42 | */ |
| 43 | public static function get_type() { |
| 44 | return 'text-shadow'; |
| 45 | } |
| 46 | |
| 47 | /** |
| 48 | * Init fields. |
| 49 | * |
| 50 | * Initialize text shadow control fields. |
| 51 | * |
| 52 | * @since 1.6.0 |
| 53 | * @access protected |
| 54 | * |
| 55 | * @return array Control fields. |
| 56 | */ |
| 57 | protected function init_fields() { |
| 58 | $controls = []; |
| 59 | |
| 60 | $controls['text_shadow'] = [ |
| 61 | 'label' => esc_html__( 'Text Shadow', 'elementor' ), |
| 62 | 'type' => Controls_Manager::TEXT_SHADOW, |
| 63 | 'selectors' => [ |
| 64 | '{{SELECTOR}}' => 'text-shadow: {{HORIZONTAL}}px {{VERTICAL}}px {{BLUR}}px {{COLOR}};', |
| 65 | ], |
| 66 | ]; |
| 67 | |
| 68 | return $controls; |
| 69 | } |
| 70 | |
| 71 | /** |
| 72 | * Get default options. |
| 73 | * |
| 74 | * Retrieve the default options of the text shadow control. Used to return the |
| 75 | * default options while initializing the text shadow control. |
| 76 | * |
| 77 | * @since 1.9.0 |
| 78 | * @access protected |
| 79 | * |
| 80 | * @return array Default text shadow control options. |
| 81 | */ |
| 82 | protected function get_default_options() { |
| 83 | return [ |
| 84 | 'popover' => [ |
| 85 | 'starter_title' => esc_html__( 'Text Shadow', 'elementor' ), |
| 86 | 'starter_name' => 'text_shadow_type', |
| 87 | 'starter_value' => 'yes', |
| 88 | 'settings' => [ |
| 89 | 'render_type' => 'ui', |
| 90 | ], |
| 91 | ], |
| 92 | ]; |
| 93 | } |
| 94 | } |
| 95 |