Advertisement
Guest User

Ozh

a guest
Aug 24th, 2009
396
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.89 KB | None | 0 0
  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. */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement