Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

fix script file path for remote locations

  • Loading branch information...
commit a27a554a702dffa90713c96a91840ab2de6f26e2 1 parent 73198e0
Kaiser authored June 28, 2012

Showing 1 changed file with 14 additions and 4 deletions. Show diff stats Hide diff stats

  1. 18  inc/admin.php
18  inc/admin.php
@@ -265,11 +265,21 @@ public function scripts( $screen )
265 265
 		if ( 'plugins.php' !== $screen )
266 266
 			return;
267 267
 
  268
+		// Allow remote file directories
  269
+		$subject = plugin_dir_url( __FILE__ );
  270
+		$search  = basename( plugin_dir_url( __FILE__ ) );
  271
+		$url     = substr_replace( 
  272
+			 $subject
  273
+			,"js"
  274
+			,strrpos( $subject, $search )
  275
+			,strlen( $search ) 
  276
+		);
  277
+
268 278
 		wp_enqueue_script(
269  
-			'cd-apd-js',
270  
-			CD_APD_URL.'js/apd.js',
271  
-			array( 'jquery' ),
272  
-			null
  279
+			 'cd-apd-js'
  280
+			,"{$url}apd.js"
  281
+			,array( 'jquery' )
  282
+			,null
273 283
 		);
274 284
 		wp_localize_script(
275 285
 			'cd-apd-js',

0 notes on commit a27a554

Please sign in to comment.
Something went wrong with that request. Please try again.