Skip to content

Instantly share code, notes, and snippets.

@sewpafly
Created January 19, 2012 07:03
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 sewpafly/1638518 to your computer and use it in GitHub Desktop.
Save sewpafly/1638518 to your computer and use it in GitHub Desktop.
WPML javascript loading error
<?php
// version 2.4.2
// line 1900
function js_load(){
if(is_admin() && !defined('DOING_AJAX')){
if(isset($_GET['page'])){
$page = basename($_GET['page']);
$page_basename = str_replace('.php','',$page);
}else{
$page_basename = false;
}
wp_enqueue_script('sitepress-scripts', ICL_PLUGIN_URL . '/res/js/scripts.js', array('jquery'), ICL_SITEPRESS_VERSION);
if(isset($page_basename) && file_exists(ICL_PLUGIN_PATH . '/res/js/'.$page_basename.'.js')){
wp_enqueue_script('sitepress-' . $page_basename, ICL_PLUGIN_URL . '/res/js/'.$page_basename.'.js', array(), ICL_SITEPRESS_VERSION);
}
}
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment