钩子文档

salt

💡 云策文档标注

概述

本文档介绍 WordPress 的 'salt' 过滤器,用于过滤 WordPress 的盐值。该过滤器允许开发者修改特定认证方案的盐值。

关键要点

  • 'salt' 过滤器用于过滤 WordPress 的盐值,参数包括 $cached_salt(给定方案的缓存盐)和 $scheme(认证方案)。
  • 认证方案 $scheme 的取值包括 'auth'、'secure_auth'、'logged_in' 和 'nonce'。
  • 该过滤器在 wp_salt() 函数中被调用,用于返回添加到哈希的盐值。
  • 自 WordPress 2.5.0 版本引入。

📄 原文内容

Filters the WordPress salt.

Parameters

$cached_saltstring
Cached salt for the given scheme.
$schemestring
Authentication scheme. Values include 'auth', 'secure_auth', 'logged_in', and 'nonce'.

Source

return apply_filters( 'salt', $cached_salts[ $scheme ], $scheme );

Changelog

Version Description
2.5.0 Introduced.