| @@ -68,11 +68,8 @@ | ||
| 68 | 68 | } |
| 69 | 69 | if ( ! empty( $typography_classes ) ) { |
| 70 | 70 | $input_classes[] = $typography_classes; |
| 71 | 71 | } |
| 72 | - if ( ! $show_button && ! empty( $color_classes ) ) { | |
| 73 | - $input_classes[] = $color_classes; | |
| 74 | - } | |
| 75 | 72 | if ( $input->next_tag() ) { |
| 76 | 73 | $input->add_class( implode( ' ', $input_classes ) ); |
| 77 | 74 | $input->set_attribute( 'id', $input_id ); |
| 78 | 75 | $input->set_attribute( 'value', get_search_query( false ) ); |
| @@ -432,39 +429,22 @@ | ||
| 432 | 429 | } |
| 433 | 430 | } |
| 434 | 431 | } |
| 435 | 432 | |
| 436 | - $use_input_for_colors = ! empty( $attributes['buttonPosition'] ) && 'no-button' === $attributes['buttonPosition']; | |
| 437 | - | |
| 438 | 433 | // Add color styles. |
| 439 | 434 | $has_text_color = ! empty( $attributes['style']['color']['text'] ); |
| 440 | 435 | if ( $has_text_color ) { |
| 441 | - $text_color_style = sprintf( 'color: %s;', $attributes['style']['color']['text'] ); | |
| 442 | - if ( $use_input_for_colors ) { | |
| 443 | - $input_styles[] = $text_color_style; | |
| 444 | - } else { | |
| 445 | - $button_styles[] = $text_color_style; | |
| 446 | - } | |
| 436 | + $button_styles[] = sprintf( 'color: %s;', $attributes['style']['color']['text'] ); | |
| 447 | 437 | } |
| 448 | 438 | |
| 449 | 439 | $has_background_color = ! empty( $attributes['style']['color']['background'] ); |
| 450 | 440 | if ( $has_background_color ) { |
| 451 | - $background_color_style = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] ); | |
| 452 | - if ( $use_input_for_colors ) { | |
| 453 | - $input_styles[] = $background_color_style; | |
| 454 | - } else { | |
| 455 | - $button_styles[] = $background_color_style; | |
| 456 | - } | |
| 441 | + $button_styles[] = sprintf( 'background-color: %s;', $attributes['style']['color']['background'] ); | |
| 457 | 442 | } |
| 458 | 443 | |
| 459 | 444 | $has_custom_gradient = ! empty( $attributes['style']['color']['gradient'] ); |
| 460 | 445 | if ( $has_custom_gradient ) { |
| 461 | - $custom_gradient_style = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] ); | |
| 462 | - if ( $use_input_for_colors ) { | |
| 463 | - $input_styles[] = $custom_gradient_style; | |
| 464 | - } else { | |
| 465 | - $button_styles[] = $custom_gradient_style; | |
| 466 | - } | |
| 446 | + $button_styles[] = sprintf( 'background: %s;', $attributes['style']['color']['gradient'] ); | |
| 467 | 447 | } |
| 468 | 448 | |
| 469 | 449 | // Get typography styles to be shared across inner elements. |
| 470 | 450 | $typography_styles = esc_attr( get_typography_gutenberg_styles_for_block_core_search( $attributes ) ); |