Skip to content

Instantly share code, notes, and snippets.

@Shelob9
Created March 22, 2014 19:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Shelob9/9712542 to your computer and use it in GitHub Desktop.
Save Shelob9/9712542 to your computer and use it in GitHub Desktop.
public function scripts() {
$suffix = ( defined('_SF2_DEV') AND _SF2_DEV ) ? '' : '.min';
wp_enqueue_script( 'foundation', trailingslashit(_SF2_JS)."foundation{$suffix}.js", array( 'jquery' ), '5.2.0', true );
wp_enqueue_script( 'modernizer', trailingslashit(_SF2_JS)."custom.modernizr{$suffix}.js", array( 'jquery'), false, true );
foreach ($this->foundation as $script) {
$src = trailingslashit(_SF2_JS).$script[ 'file' ].$suffix.'.js';
wp_enqueue_script( $script[ 'name' ], $src, array( 'jquery', 'foundation' ), '5.2.0', true );
}
wp_enqueue_script( '_SF2', trailingslashit(_SF2_JS)."sf2{$suffix}.js", array('foundation', 'jquery'), false, true );
//localize data onto _sf2
$bg = backstretch::bg();
$data = array(
'siteTitle' => esc_attr( get_bloginfo( 'name', 'display' ) ),
'homeURL' => esc_url( home_url( '/' ) ),
'headerBG' => $bg[ 'header' ],
'pageBG' => $bg[ 'page' ]
);
wp_localize_script( '_SF2', 'sf2', $data );
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment