钩子文档

permalink_structure_changed

💡 云策文档标注

概述

这是一个 WordPress 动作钩子,在固定链接结构更新后触发,允许开发者执行自定义操作。

关键要点

  • 钩子名称:permalink_structure_changed
  • 触发时机:固定链接结构更新后
  • 参数:$old_permalink_structure(旧结构字符串)和 $permalink_structure(新结构字符串)
  • 来源:do_action( 'permalink_structure_changed', $old_permalink_structure, $permalink_structure )
  • 相关函数:WP_Rewrite::set_permalink_structure() 用于设置站点固定链接结构
  • 版本历史:自 WordPress 2.8.0 引入

📄 原文内容

Fires after the permalink structure is updated.

Parameters

$old_permalink_structurestring
The previous permalink structure.
$permalink_structurestring
The new permalink structure.

Source

do_action( 'permalink_structure_changed', $old_permalink_structure, $permalink_structure );

Changelog

Version Description
2.8.0 Introduced.