SHARE
TWEET

Ozh

a guest Aug 24th, 2009 177 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Original, doesn't work
  2. $olt_checklist_callback = create_function('$base_url', // Version specific init callback
  3.     'include_once("'.dirname(__FILE__).'/olt-checklist.php");'.
  4.     '$js_url  = $base_url . "/olt-checklist.js";'.
  5.     '$css_url = $base_url . "/olt-checklist.css";'.
  6.     'wp_enqueue_script("olt-checklist",$js_url,array("jquery","jquery-ui-tabs"));'.
  7.     'wp_enqueue_style("olt-checklist",$css_url);'
  8. );
  9.  
  10. // Fixed, works
  11. $olt_checklist_callback = create_function('$base_url', // Version specific init callback
  12.     'require_once(dirname(__FILE__)."/olt-checklist.php");'.
  13.     '$js_url  = $base_url . "/olt-checklist.js";'.
  14.     '$css_url = $base_url . "/olt-checklist.css";'.
  15.     'wp_enqueue_script("olt-checklist",$js_url,array("jquery","jquery-ui-tabs"));'.
  16.     'wp_enqueue_style("olt-checklist",$css_url);'
  17. );
  18.  
  19. /*
  20. the only change is that __FILE__ is computed at runtime
  21. */
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top