Localize scripts

This commit is contained in:
Brian Miyaji
2014-01-20 11:48:12 +11:00
parent 62501fd76a
commit 12f3d9cf5a
6 changed files with 20 additions and 19 deletions

View File

@@ -1,11 +1,13 @@
<?php
function sportspress_admin_enqueue_scripts() {
wp_register_style( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL . 'assets/css/admin.css', array(), time() );
wp_enqueue_style( 'sportspress-admin');
wp_enqueue_style( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL . 'assets/css/admin.css', array(), time() );
wp_enqueue_script( 'jquery' );
wp_enqueue_script( 'google-maps', 'http://maps.googleapis.com/maps/api/js?sensor=false&libraries=places' );
wp_enqueue_script( 'jquery-locationpicker', SPORTSPRESS_PLUGIN_URL .'/assets/js/locationpicker.jquery.js', array( 'jquery' ), '0.1.6', true );
wp_enqueue_script( 'sportspress-admin', SPORTSPRESS_PLUGIN_URL .'/assets/js/admin.js', array( 'jquery' ), time(), true );
wp_localize_script( 'sportspress-admin', 'localized_strings', array(
'remove_text' => __( 'Remove', 'sportspress' )
) );
}
add_action( 'admin_enqueue_scripts', 'sportspress_admin_enqueue_scripts' );