Not loading js file correctly
-
Hi,
I had a problem with loading of the .js file and I had to replace part of the code from /wp-content/plugins/wp-category-permalink/lib/ui.php from line 19
OLD:
public static function enqueue_script() { $url = plugins_url('/wp-category-permalink.js', __DIR__ . '/../..' ); wp_enqueue_script( 'wp-category-permalink.js', $url, array( 'jquery' ), '1.8', false ); }
NEW:
public static function enqueue_script() { $url = plugins_url('/wp-category-permalink.js', '/wp-category-permalink/' . '/..' ); wp_enqueue_script( 'wp-category-permalink.js', $url, array( 'jquery' ), '1.8', false ); }
The problem was that the .js file was not loading correctly. Structure was incorrect. Here is wat it looked like in the source:
<script type='text/javascript' src='https://www.example.fi/example/wp-content/plugins/__DIR__/../wp-category-permalink.js?ver=1.8'></script>
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Not loading js file correctly’ is closed to new replies.