Dynamically determine URI to scripts and styles included with a class which could be added from plugin/theme/child theme/mu plugin
For plugins it is: $plugin_url = plugin_dir_url( __FILE__ ); This works even if wp-content is on a separate domain. You may get problems if your class is in a subdirectory of the plugin – you should probably make the __FILE__ a parameter for a function: public function get_plugin_url( $base = __FILE__ ) { return plugin_dir_url( … Read more