Skip to content

Commit

Permalink
Localising SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
cameronjonesweb committed Apr 19, 2016
1 parent 43373a0 commit cd9d9d0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions facebook-page-feed-graph-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,10 @@ function facebook_page_plugin( $filter ) {
), $filter );
if(isset($a['href']) && !empty($a['href'])){
$a['language'] = str_replace("-", "_", $a['language']);

//Send the language as a parameter to the SDK
wp_localize_script( 'facebook-page-plugin-sdk', 'facebook_page_plugin_language', array( 'language' => $a['language'] ) );

$return .= '<div class="cameronjonesweb_facebook_page_plugin" data-version="' . CJW_FBPP_PLUGIN_VER . '" id="' . $this->facebook_page_plugin_generate_wrapper_id() . '">';
$return .= '<div id="fb-root"></div><script>(function(d, s, id) {var js, fjs = d.getElementsByTagName(s)[0];if (d.getElementById(id)) return;js = d.createElement(s); js.id = id;js.src = "//connect.facebook.net/' . $a['language'] . '/sdk.js#xfbml=1&version=v2.5&appId=846690882110183";fjs.parentNode.insertBefore(js, fjs); }(document, \'script\', \'facebook-jssdk\'));</script>';
$return .= '<div class="fb-page" data-href="https://facebook.com/' . $a["href"] . '" ';
Expand Down

0 comments on commit cd9d9d0

Please sign in to comment.