Skip to content

Commit

Permalink
Twitter Widget: remove deprecated color-link parameter (#14742)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeherve authored Feb 21, 2020
1 parent a49646f commit 618d882
Showing 1 changed file with 3 additions and 21 deletions.
24 changes: 3 additions & 21 deletions modules/widgets/twitter-timeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ public function widget( $args, $instance ) {
'width',
'height',
'theme',
'link-color',
'border-color',
'tweet-limit',
'lang',
Expand Down Expand Up @@ -258,12 +257,9 @@ public function update( $new_instance, $old_instance ) {

$instance['widget-id'] = sanitize_text_field( $new_instance['widget-id'] );

$hex_regex = '/#([a-f]|[A-F]|[0-9]){3}(([a-f]|[A-F]|[0-9]){3})?\b/';
foreach ( array( 'link-color', 'border-color' ) as $color ) {
$new_color = sanitize_text_field( $new_instance[ $color ] );
if ( preg_match( $hex_regex, $new_color ) ) {
$instance[ $color ] = $new_color;
}
$new_border_color = sanitize_hex_color( $new_instance['border-color'] );
if ( ! empty( $new_border_color ) ) {
$instance['border-color'] = $new_border_color;
}

$instance['type'] = 'profile';
Expand Down Expand Up @@ -319,7 +315,6 @@ public function form( $instance ) {
'height' => '400',
'type' => 'profile',
'widget-id' => '',
'link-color' => '#f96e5b',
'border-color' => '#e8e8e8',
'theme' => 'light',
'chrome' => array(),
Expand Down Expand Up @@ -457,19 +452,6 @@ class="widefat"
</label>
</p>

<p>
<label for="<?php echo $this->get_field_id( 'link-color' ); ?>">
<?php _e( 'Link Color (hex):', 'jetpack' ); ?>
</label>
<input
class="widefat"
id="<?php echo $this->get_field_id( 'link-color' ); ?>"
name="<?php echo $this->get_field_name( 'link-color' ); ?>"
type="text"
value="<?php echo esc_attr( $instance['link-color'] ); ?>"
/>
</p>

<p>
<label for="<?php echo $this->get_field_id( 'border-color' ); ?>">
<?php _e( 'Border Color (hex):', 'jetpack' ); ?>
Expand Down

0 comments on commit 618d882

Please sign in to comment.