通过主题编辑器整理url显示的文件名。
原型
_get_template_edit_filename( string $fullpath, string $containingfolder )
参数
$fullpath
(string)
(Required)
主题文件的完整路径
$containingfolder
(string)
(Required)
主题父文件夹的路径
返回值
(string)
源文件
路径:wp-admin/includes/theme.php
<?php
...
function _get_template_edit_filename($fullpath, $containingfolder) {
return str_replace(dirname(dirname( $containingfolder )) , '', $fullpath);
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/_get_template_edit_filename/