Skip to content

Commit

Permalink
Merge pull request #643 from stellarwp/bugfix/KAD-3949
Browse files Browse the repository at this point in the history
bugfix/KAD-3949
  • Loading branch information
oakesjosh authored Jan 7, 2025
2 parents 08a9126 + 4c83499 commit f4a69a3
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions includes/blocks/class-kadence-blocks-advanced-heading-block.php
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,16 @@ public function build_css( $attributes, $css, $unique_id, $unique_style_id ) {
}
}
if ( (isset($attributes['enableTextShadow']) && !empty($attributes['enableTextShadow']) || (isset($attributes['textShadow']) && !empty($attributes['textShadow'][0]['enable'])) ) ) {
if ( empty( $attributes['textShadow'] ) ) {
$attributes['textShadow'] = [
[
'hOffset' => 1,
'vOffset' => 1,
'blur' => 1,
'color' => 'rgba(0,0,0,0.2)',
],
];
}
if ( isset( $attributes['textShadow'] ) && is_array( $attributes['textShadow'] ) && isset( $attributes['textShadow'][0] ) && is_array( $attributes['textShadow'][0] ) && ((isset( $attributes['enableTextShadow'] ) && $attributes['enableTextShadow']) || (isset( $attributes['textShadow'][0]['enable'] ) && $attributes['textShadow'][0]['enable']) ) ) {
$css->add_property( 'text-shadow', ( isset( $attributes['textShadow'][0]['hOffset'] ) ? $attributes['textShadow'][0]['hOffset'] : 1 ) . 'px ' . ( isset( $attributes['textShadow'][0]['vOffset'] ) ? $attributes['textShadow'][0]['vOffset'] : 1 ) . 'px ' . ( isset( $attributes['textShadow'][0]['blur'] ) ? $attributes['textShadow'][0]['blur'] : 1 ) . 'px ' . ( isset( $attributes['textShadow'][0]['color'] ) ? $css->render_color( $attributes['textShadow'][0]['color'] ) : 'rgba(0,0,0,0.2)' ) );
}
Expand Down

0 comments on commit f4a69a3

Please sign in to comment.