钩子文档

newblogname

💡 云策文档标注

概述

newblogname 是一个 WordPress 过滤器钩子,用于在站点注册过程中过滤新站点的名称。该名称根据网络设置可能是子域名或子目录路径。

关键要点

  • newblogname 是一个过滤器钩子,允许开发者在站点注册时修改站点名称。
  • 站点名称可以是子域名或子目录路径,具体取决于网络配置。
  • 该钩子通过 apply_filters 调用,参数为字符串类型的站点名称。
  • 相关函数 wpmu_validate_blog_signup() 用于处理新站点注册。
  • 自 WordPress MU 3.0.0 版本引入。

代码示例

$blogname = apply_filters( 'newblogname', $blogname );

📄 原文内容

Filters the new site name during registration.

Description

The name is the site’s subdomain or the site’s subdirectory path depending on the network settings.

Parameters

$blognamestring
Site name.

Source

$blogname = apply_filters( 'newblogname', $blogname );

Changelog

Version Description
MU (3.0.0) Introduced.