plugin_dir_path

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

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

獲取所傳遞的外掛__FILE__的檔案系統目錄路徑(帶尾部斜線)。

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

常見問題

FAQs
檢視更多 >