Wordpress get plugin directory

前端 未结 14 845
广开言路
广开言路 2021-01-31 02:09

Is there any function that would return the full path of my plugin in WordPress?

Example is

path/wp-contents/plugins/myplugin

I have tr

14条回答
  •  伪装坚强ぢ
    2021-01-31 02:56

    I will suggest following code. if you are accessing this function from any subfolder.

    plugins_url( 'images/logo.png' , dirname(__FILE__ ));
    

提交回复
热议问题