Skip to content

Commit

Permalink
Merge pull request #12 from cameronjonesweb/ticket-11
Browse files Browse the repository at this point in the history
Ticket 11 - Resolves issue #11
  • Loading branch information
cameronjonesweb committed Apr 19, 2016
2 parents 50232a2 + cd9d9d0 commit b036b9f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions facebook-page-feed-graph-api.php
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@ function facebook_page_plugin_generate_wrapper_id() {
//Client side stuff
//Parse shortcode
function facebook_page_plugin( $filter ) {
wp_enqueue_script( 'facebook-page-plugin-sdk', CJW_FBPP_PLUGIN_URL . 'js/sdk.js', array(), NULL, true );
wp_enqueue_script( 'facebook-page-plugin-responsive-script', CJW_FBPP_PLUGIN_URL . 'js/responsive.min.js', 'jquery', NULL, true );
$return = NULL;
$a = shortcode_atts( array(
Expand All @@ -119,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
1 change: 1 addition & 0 deletions js/sdk.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit b036b9f

Please sign in to comment.