钩子文档

theme_root

💡 云策文档标注

概述

theme_root 是一个 WordPress 过滤器,用于修改主题目录的绝对路径。它允许开发者动态调整主题的存储位置。

关键要点

  • 这是一个过滤器,用于过滤主题目录的绝对路径。
  • 参数 $theme_root 是一个字符串,表示主题目录的绝对路径。
  • 源代码中通过 apply_filters('theme_root', $theme_root) 调用此过滤器。

相关函数

  • get_theme_root():用于检索主题目录的路径。

版本历史

  • 1.5.0:此过滤器在 WordPress 1.5.0 版本中引入。

📄 原文内容

Filters the absolute path to the themes directory.

Parameters

$theme_rootstring
Absolute path to themes directory.

Source

return apply_filters( 'theme_root', $theme_root );

Changelog

Version Description
1.5.0 Introduced.