Skip to content

Commit

Permalink
Facebook Page Plugin: update deprecated stream attribute (#13725)
Browse files Browse the repository at this point in the history
* Facebook Page Plugin: update deprecated stream attribute

Fixes #13717

This attribute has now been deprecated by Facebook:
> The attribute data-show-posts is deprecated. Please use the attribute tabs/data-tabs and use the value timeline to show posts from the Page's timeline.
-- https://developers.facebook.com/docs/plugins/page-plugin/

This updates to the new recommended attribute.

* Update Widget UI as per recommendations.

See #13725 (comment)
  • Loading branch information
jeherve authored and kraftbj committed Oct 25, 2019
1 parent 1b07673 commit 8f87bd7
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions modules/widgets/facebook-likebox.php
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function widget( $args, $instance ) {
$page_url = set_url_scheme( $like_args['href'], 'https' );

$like_args['show_faces'] = (bool) $like_args['show_faces'] ? 'true' : 'false';
$like_args['stream'] = (bool) $like_args['stream'] ? 'true' : 'false';
$like_args['stream'] = (bool) $like_args['stream'] ? 'timeline' : 'false';
$like_args['cover'] = (bool) $like_args['cover'] ? 'false' : 'true';

echo $before_widget;
Expand Down Expand Up @@ -105,7 +105,7 @@ function widget( $args, $instance ) {

?>
<div id="fb-root"></div>
<div class="fb-page" data-href="<?php echo esc_url( $page_url ); ?>" data-width="<?php echo intval( $like_args['width'] ); ?>" data-height="<?php echo intval( $like_args['height'] ); ?>" data-hide-cover="<?php echo esc_attr( $like_args['cover'] ); ?>" data-show-facepile="<?php echo esc_attr( $like_args['show_faces'] ); ?>" data-show-posts="<?php echo esc_attr( $like_args['stream'] ); ?>">
<div class="fb-page" data-href="<?php echo esc_url( $page_url ); ?>" data-width="<?php echo intval( $like_args['width'] ); ?>" data-height="<?php echo intval( $like_args['height'] ); ?>" data-hide-cover="<?php echo esc_attr( $like_args['cover'] ); ?>" data-show-facepile="<?php echo esc_attr( $like_args['show_faces'] ); ?>" data-tabs="<?php echo esc_attr( $like_args['stream'] ); ?>">
<div class="fb-xfbml-parse-ignore"><blockquote cite="<?php echo esc_url( $page_url ); ?>"><a href="<?php echo esc_url( $page_url ); ?>"><?php echo esc_html( $title ); ?></a></blockquote></div>
</div>
<?php
Expand Down Expand Up @@ -193,7 +193,7 @@ function form( $instance ) {
<p>
<label for="<?php echo esc_attr( $this->get_field_id( 'stream' ) ); ?>">
<input type="checkbox" name="<?php echo esc_attr( $this->get_field_name( 'stream' ) ); ?>" id="<?php echo esc_attr( $this->get_field_id( 'stream' ) ); ?>" <?php checked( $like_args['stream'] ); ?> />
<?php _e( 'Show Stream', 'jetpack' ); ?>
<?php _e( 'Show Timeline', 'jetpack' ); ?>
<br />
<small><?php _e( 'Show Page Posts.', 'jetpack' ); ?></small>
</label>
Expand Down

0 comments on commit 8f87bd7

Please sign in to comment.