get plugin directory url

Use plugin_dir_url( __FILE__ ); for the URL and plugin_dir_path( __FILE__ ); for the path.

Pass the plugin’s main file to both functions to get similar results.

Besides that, ADMIN_PATH and ADMIN_DIR are really poor names for custom code. They might result in collisions with other code in the future. Try to use better names, something with a unique prefix.

Leave a Comment