From e58563860a11d2ff7cb32e539079c1a62b15d4f6 Mon Sep 17 00:00:00 2001 From: Jeremy Herve Date: Thu, 19 Jan 2017 12:08:46 +0100 Subject: [PATCH] Twitter Widget: add noscrollbar option back. The option was removed in #4198, but it is still supported by Twitter: https://dev.twitter.com/web/embedded-timelines#customization To be be able to hide the scrollbar, you should not specify a number of tweets in the widget. If you do, the `data-tweet-limit` attribute will be added to the widget and the timeline will automatically adjust its height to fit the specified number of Tweets. That's most likely why we thought the option didn't work when testing in #4198. Reported here: https://twitter.com/LorrieW_Art/status/822005258096406529 --- modules/widgets/twitter-timeline.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/modules/widgets/twitter-timeline.php b/modules/widgets/twitter-timeline.php index 573127f59ee74..bc0b7d16d6781 100644 --- a/modules/widgets/twitter-timeline.php +++ b/modules/widgets/twitter-timeline.php @@ -81,7 +81,7 @@ public function widget( $args, $instance ) { echo $args['before_widget']; $title = isset( $instance['title'] ) ? $instance['title'] : ''; - + /** This filter is documented in core/src/wp-includes/default-widgets.php */ $title = apply_filters( 'widget_title', $title ); if ( ! empty( $title ) ) { @@ -222,7 +222,8 @@ public function update( $new_instance, $old_instance ) { 'noheader', 'nofooter', 'noborders', - 'transparent' + 'transparent', + 'noscrollbar', ); if ( isset( $new_instance['chrome'] ) ) { foreach ( $new_instance['chrome'] as $chrome ) { @@ -414,6 +415,16 @@ class="widefat"
+ + id="get_field_id( 'chrome-noscrollbar' ); ?>" + name="get_field_name( 'chrome' ); ?>[]" + value="noscrollbar" + /> + +
id="get_field_id( 'chrome-transparent' ); ?>"