kground_color || $has_named_background_color ) { $classes[] = 'has-background'; } // Apply background color classes or styles. if ( $has_named_background_color ) { $classes[] = sprintf( 'has-%s-background-color', $block_attributes['backgroundColor'] ); } elseif ( $has_custom_background_color ) { $styles[] = sprintf( 'background-color: %s;', $block_attributes['style']['color']['background'] ); } } // Gradients. if ( $has_gradients_support ) { $has_named_gradient = array_key_exists( 'gradient', $block_attributes ); $has_custom_gradient = isset( $block_attributes['style']['color']['gradient'] ); if ( $has_named_gradient || $has_custom_gradient ) { $classes[] = 'has-background'; } // Apply required background class. if ( $has_named_gradient ) { $classes[] = sprintf( 'has-%s-gradient-background', $block_attributes['gradient'] ); } elseif ( $has_custom_gradient ) { $styles[] = sprintf( 'background: %s;', $block_attributes['style']['color']['gradient'] ); } } $attributes = array(); if ( ! empty( $classes ) ) { $attributes['class'] = implode( ' ', $classes ); } if ( ! empty( $styles ) ) { $attributes['style'] = implode( ' ', $styles ); } return $attributes; } // Register the block support. WP_Block_Supports::get_instance()->register( 'colors', array( 'register_attribute' => 'wp_register_colors_support', 'apply' => 'wp_apply_colors_support', ) ); Lincolnshire-Riverwoods FPD | Chicago Area Fire Departments
Select Page