plugin_dir_url

函式
plugin_dir_url ( $file )
引數
  • (string) $file The filename of the plugin (__FILE__).
    Required:
返回值
  • (string) the URL path of the directory that contains the plugin.
定義位置
相關方法
plugins_urlplugin_dir_pathwp_login_urlplugins_apiget_plugin_files
引入
2.8.0
棄用
-

plugin_dir_url: 這個函式用於獲取外掛目錄的URL。它需要一個引數:$file,這是外掛檔案的名稱: 該函式返回該外掛目錄的URL。

獲取傳入的外掛__FILE__的URL目錄路徑(帶尾部斜線)。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function plugin_dir_url( $file ) {
return trailingslashit( plugins_url( '', $file ) );
}
function plugin_dir_url( $file ) { return trailingslashit( plugins_url( '', $file ) ); }
function plugin_dir_url( $file ) {
	return trailingslashit( plugins_url( '', $file ) );
}

常見問題

FAQs
檢視更多 >