• Resolved eppu

    (@eppu)


    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='http://www.example.fi/example/wp-content/plugins/__DIR__/../wp-category-permalink.js?ver=1.8'></script>

    https://ww.wp.xz.cn/plugins/wp-category-permalink/

Viewing 1 replies (of 1 total)
  • Plugin Author Jordy Meow

    (@tigroumeow)

    Hello,

    Yes, that happens with an older version of PHP. Thanks for the quick fix 🙂 We fixed it another way, it will be push in the repo very soon. Thank you for finding this out.

Viewing 1 replies (of 1 total)

The topic ‘Not loading js file correctly’ is closed to new replies.