Is it safe to pass directory path to plugins_url()?

__DIR__ is rather new and not always supported. Use dirname( __FILE__ ).

plugins_url() is using …

$folder = dirname(plugin_basename($plugin));

… so yes, it is safe.

Just use plugins_url( 'subfolder/file.css', dirname( __FILE__ ) )

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)