钩子文档

self_admin_url

💡 云策文档标注

概述

self_admin_url 是一个 WordPress 过滤器钩子,用于根据上下文(当前站点或网络)过滤管理区域的 URL。它允许开发者修改 URL 的生成方式。

关键要点

  • 过滤器钩子名称为 'self_admin_url',用于过滤 admin URL。
  • 参数包括 $url(完整 URL)、$path(相对路径)和 $scheme(协议方案)。
  • 相关函数 self_admin_url() 用于检索管理区域 URL。
  • 首次引入于 WordPress 4.9.0 版本。

📄 原文内容

Filters the admin URL for the current site or network depending on context.

Parameters

$urlstring
The complete URL including scheme and path.
$pathstring
Path relative to the URL. Blank string if no path is specified.
$schemestring
The scheme to use.

Source

return apply_filters( 'self_admin_url', $url, $path, $scheme );

Changelog

Version Description
4.9.0 Introduced.