Differences Between plugins_url(‘aaa.php’) and plugins_url(‘aaa.php’, dirname(__FILE__)) in WordPress

I’d like to know if there are differences in these two different usage of plugin_url(). They both produce the same string.

echo plugins_url('aaa.php')

echo plugins_url('aaa.php', dirname(__FILE__));

When is one used and the other not?

Read More

Thanks.

Related posts

Leave a Reply

1 comment

  1. echo plugins_url('aaa.php')

    –> This is used for normal wordpress

    echo plugins_url('aaa.php', dirname(__FILE__));

    –> This is used for Multi network

    if you define dirname(__FILE__) in plugins_url function

    then it takes WordPress Multi Network Plugins url

    otherwise it takes Direct WordPress Plugin url