Created
March 22, 2014 19:05
-
-
Save Shelob9/9712542 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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