Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enqueued CSS and JS files reference the server path, not the public web path #163

Open
3v-afranz-deactivated opened this issue Apr 28, 2023 · 0 comments

Comments

@3v-afranz-deactivated
Copy link

When you enqueue files:

wp_enqueue_style( 'csf', self::include_plugin_url( 'assets/css/style'. $min .'.css' ), array(), self::$version, 'all' );

The method include_plugin_url retrieves the server path, not the URL.

This is what is being returned:

<script src='https://domain.example:/wp-content/themes/theme-name/mnt/aws-instance/deployments/100/plugins/interactive-geo-maps-premium/vendor/saltus/framework/lib/codestar-framework/assets/js/plugins.min.js?ver=2.2.4' id='csf-plugins-js'></script>

As you can see, the path is wrong, it gets fixed with:

wp_enqueue_script( 'csf-plugins', plugin_dir_url( __DIR__ ) . 'assets/js/plugins'. $min .'.js', array(), self::$version, true );`

You may want to look into this.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant