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__的文件系统目录路径(带尾部斜线)。

function plugin_dir_path( $file ) {
	return trailingslashit( dirname( $file ) );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2025-12-05 19:32:59

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: