diff --git a/facebook-page-feed-graph-api.php b/facebook-page-feed-graph-api.php index c654291..f0ff543 100644 --- a/facebook-page-feed-graph-api.php +++ b/facebook-page-feed-graph-api.php @@ -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( @@ -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 .= '
'; $return .= '
'; $return .= '