Permalink
Browse files

fix script file path for remote locations

  • Loading branch information...
1 parent 73198e0 commit a27a554a702dffa90713c96a91840ab2de6f26e2 franz-josef-kaiser committed Jun 28, 2012
Showing with 14 additions and 4 deletions.
  1. +14 −4 inc/admin.php
View
@@ -265,11 +265,21 @@ public function scripts( $screen )
if ( 'plugins.php' !== $screen )
return;
+ // Allow remote file directories
+ $subject = plugin_dir_url( __FILE__ );
+ $search = basename( plugin_dir_url( __FILE__ ) );
+ $url = substr_replace(
+ $subject
+ ,"js"
+ ,strrpos( $subject, $search )
+ ,strlen( $search )
+ );
+
wp_enqueue_script(
- 'cd-apd-js',
- CD_APD_URL.'js/apd.js',
- array( 'jquery' ),
- null
+ 'cd-apd-js'
+ ,"{$url}apd.js"
+ ,array( 'jquery' )
+ ,null
);
wp_localize_script(
'cd-apd-js',

0 comments on commit a27a554

Please sign in to comment.