Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Widget: Added option to set DoNotTrack in Twitter Timeline Widget #9359

Merged
merged 5 commits into from
Jan 2, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions modules/widgets/twitter-timeline.php
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,22 @@ public function widget( $args, $instance ) {
echo ' data-partner="' . esc_attr( $partner ) . '"';
}

/**
* Allow the activation of Do Not Track for the Twitter Timeline Widget.
*
* @see https://developer.twitter.com/en/docs/twitter-for-websites/timelines/guides/parameter-reference.html
*
* @module widgets
*
* @since 6.9.0
*
* @param bool false Should the Twitter Timeline use the DNT attribute? Default to false.
*/
$dnt = apply_filters( 'jetpack_twitter_timeline_default_dnt', false );
if ( true === $dnt ) {
echo ' data-dnt="true"';
}

if ( ! empty( $instance['chrome'] ) && is_array( $instance['chrome'] ) ) {
echo ' data-chrome="' . esc_attr( join( ' ', $instance['chrome'] ) ) . '"';
}
Expand Down