Edit File by line
/home/zeestwma/richards.../wp-conte.../plugins/jetpack/modules/widgets
File: twitter-timeline.php
<?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
[0] Fix | Delete
/**
[1] Fix | Delete
* Twitter Timeline Widget.
[2] Fix | Delete
*
[3] Fix | Delete
* Based on Evolution Twitter Timeline
[4] Fix | Delete
* (https://wordpress.org/extend/plugins/evolution-twitter-timeline/)
[5] Fix | Delete
* For details on Twitter Timelines see:
[6] Fix | Delete
* - https://twitter.com/settings/widgets
[7] Fix | Delete
* - https://dev.twitter.com/docs/embedded-timelines
[8] Fix | Delete
*
[9] Fix | Delete
* @package automattic/jetpack
[10] Fix | Delete
*/
[11] Fix | Delete
[12] Fix | Delete
// phpcs:disable Universal.Files.SeparateFunctionsFromOO.Mixed -- TODO: Move classes to appropriately-named class files.
[13] Fix | Delete
[14] Fix | Delete
use Automattic\Jetpack\Assets;
[15] Fix | Delete
use Automattic\Jetpack\Redirect;
[16] Fix | Delete
[17] Fix | Delete
if ( ! defined( 'ABSPATH' ) ) {
[18] Fix | Delete
exit( 0 );
[19] Fix | Delete
}
[20] Fix | Delete
[21] Fix | Delete
/**
[22] Fix | Delete
* Register the widget for use in Appearance -> Widgets
[23] Fix | Delete
*/
[24] Fix | Delete
function jetpack_twitter_timeline_widget_init() {
[25] Fix | Delete
register_widget( 'Jetpack_Twitter_Timeline_Widget' );
[26] Fix | Delete
}
[27] Fix | Delete
add_action( 'widgets_init', 'jetpack_twitter_timeline_widget_init' );
[28] Fix | Delete
[29] Fix | Delete
/**
[30] Fix | Delete
* Widget class.
[31] Fix | Delete
*/
[32] Fix | Delete
class Jetpack_Twitter_Timeline_Widget extends WP_Widget {
[33] Fix | Delete
/**
[34] Fix | Delete
* Register widget with WordPress.
[35] Fix | Delete
*/
[36] Fix | Delete
public function __construct() {
[37] Fix | Delete
parent::__construct(
[38] Fix | Delete
'twitter_timeline',
[39] Fix | Delete
/** This filter is documented in modules/widgets/facebook-likebox.php */
[40] Fix | Delete
apply_filters( 'jetpack_widget_name', esc_html__( 'Twitter Timeline', 'jetpack' ) ),
[41] Fix | Delete
array(
[42] Fix | Delete
'classname' => 'widget_twitter_timeline',
[43] Fix | Delete
'description' => __( 'Display an official Twitter Embedded Timeline widget.', 'jetpack' ),
[44] Fix | Delete
'customize_selective_refresh' => true,
[45] Fix | Delete
)
[46] Fix | Delete
);
[47] Fix | Delete
[48] Fix | Delete
if ( is_customize_preview() ) {
[49] Fix | Delete
add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_scripts' ) );
[50] Fix | Delete
}
[51] Fix | Delete
[52] Fix | Delete
add_action( 'admin_enqueue_scripts', array( $this, 'admin_scripts' ) );
[53] Fix | Delete
add_filter( 'widget_types_to_hide_from_legacy_widget_block', array( $this, 'hide_widget_in_block_editor' ) );
[54] Fix | Delete
}
[55] Fix | Delete
[56] Fix | Delete
/**
[57] Fix | Delete
* Remove the "Twitter Timeline" widget from the Legacy Widget block
[58] Fix | Delete
*
[59] Fix | Delete
* @param array $widget_types List of widgets that are currently removed from the Legacy Widget block.
[60] Fix | Delete
* @return array $widget_types New list of widgets that will be removed.
[61] Fix | Delete
*/
[62] Fix | Delete
public function hide_widget_in_block_editor( $widget_types ) {
[63] Fix | Delete
$widget_types[] = 'twitter_timeline';
[64] Fix | Delete
return $widget_types;
[65] Fix | Delete
}
[66] Fix | Delete
[67] Fix | Delete
/**
[68] Fix | Delete
* Enqueue scripts.
[69] Fix | Delete
*/
[70] Fix | Delete
public function enqueue_scripts() {
[71] Fix | Delete
if ( ! class_exists( 'Jetpack_AMP_Support' ) || ! Jetpack_AMP_Support::is_amp_request() ) {
[72] Fix | Delete
wp_enqueue_script( 'jetpack-twitter-timeline' );
[73] Fix | Delete
}
[74] Fix | Delete
}
[75] Fix | Delete
[76] Fix | Delete
/**
[77] Fix | Delete
* Enqueue script to improve admin UI
[78] Fix | Delete
*
[79] Fix | Delete
* @param string $hook Page hook.
[80] Fix | Delete
*/
[81] Fix | Delete
public function admin_scripts( $hook ) {
[82] Fix | Delete
// This is still 'widgets.php' when managing widgets via the Customizer.
[83] Fix | Delete
if ( 'widgets.php' === $hook ) {
[84] Fix | Delete
wp_enqueue_script(
[85] Fix | Delete
'twitter-timeline-admin',
[86] Fix | Delete
Assets::get_file_url_for_environment(
[87] Fix | Delete
'_inc/build/widgets/twitter-timeline-admin.min.js',
[88] Fix | Delete
'modules/widgets/twitter-timeline-admin.js'
[89] Fix | Delete
),
[90] Fix | Delete
array( 'jquery' ),
[91] Fix | Delete
JETPACK__VERSION,
[92] Fix | Delete
true
[93] Fix | Delete
);
[94] Fix | Delete
}
[95] Fix | Delete
}
[96] Fix | Delete
[97] Fix | Delete
/**
[98] Fix | Delete
* Front-end display of widget.
[99] Fix | Delete
*
[100] Fix | Delete
* @see WP_Widget::widget()
[101] Fix | Delete
*
[102] Fix | Delete
* @param array $args Widget arguments.
[103] Fix | Delete
* @param array $instance Saved values from database.
[104] Fix | Delete
*/
[105] Fix | Delete
public function widget( $args, $instance ) {
[106] Fix | Delete
$output = '';
[107] Fix | Delete
[108] Fix | Delete
// Twitter deprecated `data-widget-id` on 2018-05-25,
[109] Fix | Delete
// with cease support deadline on 2018-07-27.
[110] Fix | Delete
$explicit_widget_id = isset( $instance['type'] ) && 'widget-id' === $instance['type'];
[111] Fix | Delete
$implicit_widget_id = empty( $instance['type'] ) && ! empty( $instance['widget-id'] ) && is_numeric( $instance['widget-id'] );
[112] Fix | Delete
if ( $explicit_widget_id || $implicit_widget_id ) {
[113] Fix | Delete
if ( current_user_can( 'edit_theme_options' ) ) {
[114] Fix | Delete
$output .= $args['before_widget']
[115] Fix | Delete
. $args['before_title'] . esc_html__( 'Twitter Timeline', 'jetpack' ) . $args['after_title']
[116] Fix | Delete
. '<p>' . esc_html__( "The Twitter Timeline widget can't display tweets based on searches or hashtags. To display a simple list of tweets instead, change the Widget ID to a Twitter username. Otherwise, delete this widget.", 'jetpack' ) . '</p>'
[117] Fix | Delete
. '<p>' . esc_html__( '(Only administrators will see this message.)', 'jetpack' ) . '</p>'
[118] Fix | Delete
. $args['after_widget'];
[119] Fix | Delete
}
[120] Fix | Delete
[121] Fix | Delete
echo $output; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[122] Fix | Delete
return;
[123] Fix | Delete
}
[124] Fix | Delete
[125] Fix | Delete
$this->enqueue_scripts();
[126] Fix | Delete
[127] Fix | Delete
$instance['lang'] = substr( strtoupper( get_locale() ), 0, 2 );
[128] Fix | Delete
[129] Fix | Delete
$output .= $args['before_widget'];
[130] Fix | Delete
[131] Fix | Delete
$title = isset( $instance['title'] ) ? $instance['title'] : '';
[132] Fix | Delete
[133] Fix | Delete
/** This filter is documented in core/src/wp-includes/default-widgets.php */
[134] Fix | Delete
$title = apply_filters( 'widget_title', $title );
[135] Fix | Delete
if ( ! empty( $title ) ) {
[136] Fix | Delete
$output .= $args['before_title'] . $title . $args['after_title'];
[137] Fix | Delete
}
[138] Fix | Delete
[139] Fix | Delete
$possible_data_attribs = array(
[140] Fix | Delete
'width',
[141] Fix | Delete
'height',
[142] Fix | Delete
'theme',
[143] Fix | Delete
'border-color',
[144] Fix | Delete
'tweet-limit',
[145] Fix | Delete
'lang',
[146] Fix | Delete
);
[147] Fix | Delete
$data_attrs = '';
[148] Fix | Delete
foreach ( $possible_data_attribs as $att ) {
[149] Fix | Delete
if ( ! empty( $instance[ $att ] ) && ! is_array( $instance[ $att ] ) ) {
[150] Fix | Delete
$data_attrs .= ' data-' . esc_attr( $att ) . '="' . esc_attr( $instance[ $att ] ) . '"';
[151] Fix | Delete
}
[152] Fix | Delete
}
[153] Fix | Delete
[154] Fix | Delete
/** This filter is documented in modules/shortcodes/tweet.php */
[155] Fix | Delete
$partner = apply_filters( 'jetpack_twitter_partner_id', 'jetpack' );
[156] Fix | Delete
if ( ! empty( $partner ) ) {
[157] Fix | Delete
$data_attrs .= ' data-partner="' . esc_attr( $partner ) . '"';
[158] Fix | Delete
}
[159] Fix | Delete
[160] Fix | Delete
/**
[161] Fix | Delete
* Allow the activation of Do Not Track for the Twitter Timeline Widget.
[162] Fix | Delete
*
[163] Fix | Delete
* @see https://developer.twitter.com/en/docs/twitter-for-websites/timelines/guides/parameter-reference.html
[164] Fix | Delete
*
[165] Fix | Delete
* @module widgets
[166] Fix | Delete
*
[167] Fix | Delete
* @since 6.9.0
[168] Fix | Delete
*
[169] Fix | Delete
* @param bool false Should the Twitter Timeline use the DNT attribute? Default to false.
[170] Fix | Delete
*/
[171] Fix | Delete
$dnt = apply_filters( 'jetpack_twitter_timeline_default_dnt', false );
[172] Fix | Delete
if ( true === $dnt ) {
[173] Fix | Delete
$data_attrs .= ' data-dnt="true"';
[174] Fix | Delete
}
[175] Fix | Delete
[176] Fix | Delete
if ( ! empty( $instance['chrome'] ) && is_array( $instance['chrome'] ) ) {
[177] Fix | Delete
$data_attrs .= ' data-chrome="' . esc_attr( implode( ' ', $instance['chrome'] ) ) . '"';
[178] Fix | Delete
}
[179] Fix | Delete
[180] Fix | Delete
$timeline_placeholder = __( 'My Tweets', 'jetpack' );
[181] Fix | Delete
[182] Fix | Delete
/**
[183] Fix | Delete
* Filter the Timeline placeholder text.
[184] Fix | Delete
*
[185] Fix | Delete
* @module widgets
[186] Fix | Delete
*
[187] Fix | Delete
* @since 3.4.0
[188] Fix | Delete
*
[189] Fix | Delete
* @param string $timeline_placeholder Timeline placeholder text.
[190] Fix | Delete
*/
[191] Fix | Delete
$timeline_placeholder = apply_filters( 'jetpack_twitter_timeline_placeholder', $timeline_placeholder );
[192] Fix | Delete
[193] Fix | Delete
$type = ( isset( $instance['type'] ) ? $instance['type'] : '' );
[194] Fix | Delete
$widget_id = ( isset( $instance['widget-id'] ) ? $instance['widget-id'] : '' );
[195] Fix | Delete
[196] Fix | Delete
if ( class_exists( 'Jetpack_AMP_Support' ) && Jetpack_AMP_Support::is_amp_request() ) {
[197] Fix | Delete
$width = ! empty( $instance['width'] ) ? $instance['width'] : 600;
[198] Fix | Delete
$height = ! empty( $instance['height'] ) ? $instance['height'] : 480;
[199] Fix | Delete
$output .= '<amp-twitter' . $data_attrs . ' layout="responsive" data-timeline-source-type="profile" data-timeline-screen-name="' . esc_attr( $widget_id ) . '" width="' . absint( $width ) . '" height="' . absint( $height ) . '">'; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[200] Fix | Delete
$output .= esc_html( $timeline_placeholder ) . '</amp-twitter>';
[201] Fix | Delete
[202] Fix | Delete
echo $output . $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[203] Fix | Delete
return;
[204] Fix | Delete
}
[205] Fix | Delete
[206] Fix | Delete
// Start tag output
[207] Fix | Delete
// This tag is transformed into the widget markup by Twitter's
[208] Fix | Delete
// widgets.js code.
[209] Fix | Delete
$output .= '<a class="twitter-timeline"' . $data_attrs; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[210] Fix | Delete
switch ( $type ) {
[211] Fix | Delete
case 'profile':
[212] Fix | Delete
$output .= ' href="https://twitter.com/' . esc_attr( $widget_id ) . '"';
[213] Fix | Delete
break;
[214] Fix | Delete
case 'widget-id':
[215] Fix | Delete
default:
[216] Fix | Delete
$output .= ' data-widget-id="' . esc_attr( $widget_id ) . '"';
[217] Fix | Delete
break;
[218] Fix | Delete
}
[219] Fix | Delete
$output .= ' href="https://twitter.com/' . esc_attr( $widget_id ) . '"';
[220] Fix | Delete
[221] Fix | Delete
// End tag output.
[222] Fix | Delete
$output .= '>';
[223] Fix | Delete
[224] Fix | Delete
$output .= esc_html( $timeline_placeholder ) . '</a>';
[225] Fix | Delete
[226] Fix | Delete
// End tag output.
[227] Fix | Delete
[228] Fix | Delete
echo $output . $args['after_widget']; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
[229] Fix | Delete
[230] Fix | Delete
/** This action is documented in modules/widgets/gravatar-profile.php */
[231] Fix | Delete
do_action( 'jetpack_stats_extra', 'widget_view', 'twitter_timeline' );
[232] Fix | Delete
}
[233] Fix | Delete
[234] Fix | Delete
/**
[235] Fix | Delete
* Sanitize widget form values as they are saved.
[236] Fix | Delete
*
[237] Fix | Delete
* @see WP_Widget::update()
[238] Fix | Delete
*
[239] Fix | Delete
* @param array $new_instance Values just sent to be saved.
[240] Fix | Delete
* @param array $old_instance Previously saved values from database.
[241] Fix | Delete
*
[242] Fix | Delete
* @return array Updated safe values to be saved.
[243] Fix | Delete
*/
[244] Fix | Delete
public function update( $new_instance, $old_instance ) { // phpcs:ignore VariableAnalysis.CodeAnalysis.VariableAnalysis.UnusedVariable
[245] Fix | Delete
$instance = array();
[246] Fix | Delete
[247] Fix | Delete
$instance['title'] = sanitize_text_field( $new_instance['title'] );
[248] Fix | Delete
[249] Fix | Delete
$width = (int) $new_instance['width'];
[250] Fix | Delete
if ( $width ) {
[251] Fix | Delete
// From publish.twitter.com: 220 <= width <= 1200.
[252] Fix | Delete
$instance['width'] = min( max( $width, 220 ), 1200 );
[253] Fix | Delete
} else {
[254] Fix | Delete
// Set default width value to minimum.
[255] Fix | Delete
$instance['width'] = 220;
[256] Fix | Delete
}
[257] Fix | Delete
[258] Fix | Delete
$tweet_display = sanitize_text_field( $new_instance['tweet-display'] ?? 'dynamic' );
[259] Fix | Delete
$instance['tweet-display'] = $tweet_display;
[260] Fix | Delete
/**
[261] Fix | Delete
* A timeline with a specified limit is expanded to the height of those Tweets.
[262] Fix | Delete
* The specified height value no longer applies, so reject the height value
[263] Fix | Delete
* when a valid limit is set: a widget attempting to save both limit 5 and
[264] Fix | Delete
* height 400 would be saved with just limit 5.
[265] Fix | Delete
* So if the tweet display option is set to 'dynamic' the limit will be unset and we'll
[266] Fix | Delete
* take into account the height value.
[267] Fix | Delete
* If the tweet display option is set to 'fixed' the height will be unset and we'll
[268] Fix | Delete
* take into account the limit value.
[269] Fix | Delete
*/
[270] Fix | Delete
$instance['height'] = '';
[271] Fix | Delete
$instance['tweet-limit'] = null;
[272] Fix | Delete
[273] Fix | Delete
switch ( $tweet_display ) {
[274] Fix | Delete
case 'dynamic':
[275] Fix | Delete
$height = (int) $new_instance['height'];
[276] Fix | Delete
// From publish.twitter.com: height >= 200.
[277] Fix | Delete
$instance['height'] = max( $height, 200 );
[278] Fix | Delete
break;
[279] Fix | Delete
case 'fixed':
[280] Fix | Delete
$tweet_limit = (int) $new_instance['tweet-limit'];
[281] Fix | Delete
// From publish.twitter.com: 1 >= tweet-limit >= 20.
[282] Fix | Delete
$instance['tweet-limit'] = min( max( $tweet_limit, 1 ), 20 );
[283] Fix | Delete
break;
[284] Fix | Delete
}
[285] Fix | Delete
[286] Fix | Delete
// If they entered something that might be a full URL, try to parse it out.
[287] Fix | Delete
if ( is_string( $new_instance['widget-id'] ) ) {
[288] Fix | Delete
if ( preg_match(
[289] Fix | Delete
'#https?://twitter\.com/settings/widgets/(\d+)#s',
[290] Fix | Delete
$new_instance['widget-id'],
[291] Fix | Delete
$matches
[292] Fix | Delete
) ) {
[293] Fix | Delete
$new_instance['widget-id'] = $matches[1];
[294] Fix | Delete
}
[295] Fix | Delete
}
[296] Fix | Delete
[297] Fix | Delete
$instance['widget-id'] = sanitize_text_field( $new_instance['widget-id'] );
[298] Fix | Delete
[299] Fix | Delete
$new_border_color = sanitize_hex_color( $new_instance['border-color'] );
[300] Fix | Delete
if ( ! empty( $new_border_color ) ) {
[301] Fix | Delete
$instance['border-color'] = $new_border_color;
[302] Fix | Delete
}
[303] Fix | Delete
[304] Fix | Delete
$instance['type'] = 'profile';
[305] Fix | Delete
[306] Fix | Delete
$instance['theme'] = 'light';
[307] Fix | Delete
if ( in_array( $new_instance['theme'], array( 'light', 'dark' ), true ) ) {
[308] Fix | Delete
$instance['theme'] = $new_instance['theme'];
[309] Fix | Delete
}
[310] Fix | Delete
[311] Fix | Delete
$instance['chrome'] = array();
[312] Fix | Delete
$chrome_settings = array(
[313] Fix | Delete
'noheader',
[314] Fix | Delete
'nofooter',
[315] Fix | Delete
'noborders',
[316] Fix | Delete
'transparent',
[317] Fix | Delete
'noscrollbar',
[318] Fix | Delete
);
[319] Fix | Delete
[320] Fix | Delete
foreach ( $chrome_settings as $chrome ) {
[321] Fix | Delete
switch ( $chrome ) {
[322] Fix | Delete
case 'noheader':
[323] Fix | Delete
case 'nofooter':
[324] Fix | Delete
case 'noborders':
[325] Fix | Delete
case 'noscrollbar':
[326] Fix | Delete
if ( ! isset( $new_instance['chrome'] ) || ! in_array( $chrome, $new_instance['chrome'], true ) ) {
[327] Fix | Delete
$instance['chrome'][] = $chrome;
[328] Fix | Delete
}
[329] Fix | Delete
break;
[330] Fix | Delete
default:
[331] Fix | Delete
if ( isset( $new_instance['chrome'] ) && in_array( $chrome, $new_instance['chrome'], true ) ) {
[332] Fix | Delete
$instance['chrome'][] = $chrome;
[333] Fix | Delete
}
[334] Fix | Delete
break;
[335] Fix | Delete
}
[336] Fix | Delete
}
[337] Fix | Delete
[338] Fix | Delete
return $instance;
[339] Fix | Delete
}
[340] Fix | Delete
[341] Fix | Delete
/**
[342] Fix | Delete
* Returns a link to the documentation for a feature of this widget on
[343] Fix | Delete
* Jetpack or WordPress.com.
[344] Fix | Delete
*
[345] Fix | Delete
* @param string $hash anchor to potentially append to URL to target specific paragraph in page.
[346] Fix | Delete
*/
[347] Fix | Delete
public function get_docs_link( $hash = '' ) {
[348] Fix | Delete
if ( defined( 'IS_WPCOM' ) && IS_WPCOM ) {
[349] Fix | Delete
$base_url = 'https://wordpress.com/support/widgets/twitter-timeline-widget/';
[350] Fix | Delete
} else {
[351] Fix | Delete
$base_url = esc_url( Redirect::get_url( 'jetpack-support-extra-sidebar-widgets-twitter-timeline-widget' ) );
[352] Fix | Delete
}
[353] Fix | Delete
return '<a class="widget-access-link" href="' . $base_url . $hash . '" target="_blank"> Need help?</a>';
[354] Fix | Delete
}
[355] Fix | Delete
[356] Fix | Delete
/**
[357] Fix | Delete
* Back end widget form.
[358] Fix | Delete
*
[359] Fix | Delete
* @see WP_Widget::form()
[360] Fix | Delete
*
[361] Fix | Delete
* @param array $instance Previously saved values from database.
[362] Fix | Delete
* @return string|void
[363] Fix | Delete
*/
[364] Fix | Delete
public function form( $instance ) {
[365] Fix | Delete
$defaults = array(
[366] Fix | Delete
'title' => esc_html__( 'Follow me on Twitter', 'jetpack' ),
[367] Fix | Delete
'width' => '220',
[368] Fix | Delete
'height' => '200',
[369] Fix | Delete
'type' => 'profile',
[370] Fix | Delete
'widget-id' => '',
[371] Fix | Delete
'border-color' => '#f0f0f1',
[372] Fix | Delete
'theme' => 'light',
[373] Fix | Delete
'chrome' => array(),
[374] Fix | Delete
'tweet-limit' => 1,
[375] Fix | Delete
'tweet-display' => 'dynamic',
[376] Fix | Delete
);
[377] Fix | Delete
[378] Fix | Delete
$instance = wp_parse_args( (array) $instance, $defaults );
[379] Fix | Delete
[380] Fix | Delete
if ( 'widget-id' === $instance['type'] ) {
[381] Fix | Delete
$instance['widget-id'] = '';
[382] Fix | Delete
}
[383] Fix | Delete
[384] Fix | Delete
$instance['type'] = 'profile';
[385] Fix | Delete
[386] Fix | Delete
/**
[387] Fix | Delete
* Set the tweet-display option to 'fixed' if height is empty and tweet-limit set
[388] Fix | Delete
* to ensure backwards compatibility with pre-existing widgets.
[389] Fix | Delete
*/
[390] Fix | Delete
if ( empty( $instance['height'] ) && isset( $instance['tweet-limit'] ) ) {
[391] Fix | Delete
$instance['tweet-display'] = 'fixed';
[392] Fix | Delete
}
[393] Fix | Delete
?>
[394] Fix | Delete
[395] Fix | Delete
<p class="jetpack-twitter-timeline-widget-id-container">
[396] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'widget-id' ) ); ?>">
[397] Fix | Delete
<?php esc_html_e( 'Twitter username:', 'jetpack' ); ?>
[398] Fix | Delete
<?php
[399] Fix | Delete
echo wp_kses(
[400] Fix | Delete
$this->get_docs_link( '#twitter-username' ),
[401] Fix | Delete
array(
[402] Fix | Delete
'a' => array(
[403] Fix | Delete
'href' => array(),
[404] Fix | Delete
'rel' => array(),
[405] Fix | Delete
'target' => array(),
[406] Fix | Delete
'class' => array(),
[407] Fix | Delete
),
[408] Fix | Delete
)
[409] Fix | Delete
);
[410] Fix | Delete
?>
[411] Fix | Delete
</label>
[412] Fix | Delete
<input
[413] Fix | Delete
class="widefat"
[414] Fix | Delete
id="<?php echo esc_attr( $this->get_field_id( 'widget-id' ) ); ?>"
[415] Fix | Delete
name="<?php echo esc_attr( $this->get_field_name( 'widget-id' ) ); ?>"
[416] Fix | Delete
type="text"
[417] Fix | Delete
value="<?php echo esc_attr( $instance['widget-id'] ); ?>"
[418] Fix | Delete
/>
[419] Fix | Delete
</p>
[420] Fix | Delete
[421] Fix | Delete
<p>
[422] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>">
[423] Fix | Delete
<?php esc_html_e( 'Title:', 'jetpack' ); ?>
[424] Fix | Delete
</label>
[425] Fix | Delete
<input
[426] Fix | Delete
class="widefat"
[427] Fix | Delete
id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
[428] Fix | Delete
name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>"
[429] Fix | Delete
type="text"
[430] Fix | Delete
value="<?php echo esc_attr( $instance['title'] ); ?>"
[431] Fix | Delete
/>
[432] Fix | Delete
</p>
[433] Fix | Delete
[434] Fix | Delete
<p>
[435] Fix | Delete
<label>
[436] Fix | Delete
<strong><?php esc_html_e( 'Number of tweets shown:', 'jetpack' ); ?></strong>
[437] Fix | Delete
</label>
[438] Fix | Delete
<ul>
[439] Fix | Delete
<li>
[440] Fix | Delete
<label>
[441] Fix | Delete
<input
[442] Fix | Delete
id="<?php echo esc_attr( $this->get_field_id( 'tweet-display' ) ); ?>-dynamic"
[443] Fix | Delete
name="<?php echo esc_attr( $this->get_field_name( 'tweet-display' ) ); ?>"
[444] Fix | Delete
type="radio"
[445] Fix | Delete
class="jetpack-twitter-timeline-widget-tweet-display-radio"
[446] Fix | Delete
value="dynamic"
[447] Fix | Delete
<?php checked( 'dynamic', $instance['tweet-display'] ); ?>
[448] Fix | Delete
/>
[449] Fix | Delete
<?php esc_html_e( 'Dynamic', 'jetpack' ); ?>
[450] Fix | Delete
</label>
[451] Fix | Delete
</li>
[452] Fix | Delete
<li>
[453] Fix | Delete
<label>
[454] Fix | Delete
<input
[455] Fix | Delete
id="<?php echo esc_attr( $this->get_field_id( 'tweet-display' ) ); ?>-fixed"
[456] Fix | Delete
name="<?php echo esc_attr( $this->get_field_name( 'tweet-display' ) ); ?>"
[457] Fix | Delete
type="radio"
[458] Fix | Delete
class="jetpack-twitter-timeline-widget-tweet-display-radio"
[459] Fix | Delete
value="fixed"
[460] Fix | Delete
<?php checked( 'fixed', $instance['tweet-display'] ); ?>
[461] Fix | Delete
/>
[462] Fix | Delete
<?php esc_html_e( 'Fixed', 'jetpack' ); ?>
[463] Fix | Delete
</label>
[464] Fix | Delete
</li>
[465] Fix | Delete
</ul>
[466] Fix | Delete
</p>
[467] Fix | Delete
[468] Fix | Delete
<p class="jetpack-twitter-timeline-widget-height-container" <?php echo ( 'fixed' === $instance['tweet-display'] ) ? ' style="display:none;"' : ''; ?>>
[469] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'height' ) ); ?>">
[470] Fix | Delete
<?php esc_html_e( 'Height (in pixels; at least 200):', 'jetpack' ); ?>
[471] Fix | Delete
</label>
[472] Fix | Delete
<input
[473] Fix | Delete
class="widefat"
[474] Fix | Delete
id="<?php echo esc_attr( $this->get_field_id( 'height' ) ); ?>"
[475] Fix | Delete
name="<?php echo esc_attr( $this->get_field_name( 'height' ) ); ?>"
[476] Fix | Delete
type="number" min="200"
[477] Fix | Delete
value="<?php echo esc_attr( $instance['height'] ); ?>"
[478] Fix | Delete
/>
[479] Fix | Delete
</p>
[480] Fix | Delete
[481] Fix | Delete
<p class="jetpack-twitter-timeline-widget-tweet-limit-container" <?php echo ( 'dynamic' === $instance['tweet-display'] ) ? ' style="display:none;"' : ''; ?>>
[482] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'tweet-limit' ) ); ?>">
[483] Fix | Delete
<?php esc_html_e( 'Number of tweets in the timeline (1 to 20):', 'jetpack' ); ?>
[484] Fix | Delete
</label>
[485] Fix | Delete
<input
[486] Fix | Delete
class="widefat"
[487] Fix | Delete
id="<?php echo esc_attr( $this->get_field_id( 'tweet-limit' ) ); ?>"
[488] Fix | Delete
name="<?php echo esc_attr( $this->get_field_name( 'tweet-limit' ) ); ?>"
[489] Fix | Delete
type="number" min="1" max="20"
[490] Fix | Delete
value="<?php echo esc_attr( $instance['tweet-limit'] ); ?>"
[491] Fix | Delete
/>
[492] Fix | Delete
</p>
[493] Fix | Delete
[494] Fix | Delete
<p>
[495] Fix | Delete
<label for="<?php echo esc_attr( $this->get_field_id( 'width' ) ); ?>">
[496] Fix | Delete
<?php esc_html_e( 'Maximum width (in pixels; 220 to 1200):', 'jetpack' ); ?>
[497] Fix | Delete
</label>
[498] Fix | Delete
<input
[499] Fix | Delete
12
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function