wpseek.com
WordPress开发者和主题制作者的搜索引擎



_wp_secrets_set › WordPress Function

Since7.2.0
已弃用n/a
› _wp_secrets_set ( $name, $value, $network, $needs_rotation = false, $action_override = null )
访问:
  • private
参数: (5)
  • (string) $name The secret's name.
    Required: Yes
  • (string) $value The plaintext value.
    Required: Yes
  • (bool) $network Whether this is a network-scope secret.
    Required: Yes
  • (bool) $needs_rotation Flag the stored secret as needing rotation.
    Required: No
    默认: false
  • (string|null) $action_override Overrides the $action reported to wp_secret_changed.
    Required: No
    默认: null
返回:
  • (true|WP_Error)
定义在:
文档:

Shared implementation behind wp_set_secret() and wp_set_network_secret().



源码

function _wp_secrets_set(
	string $name,
	#[\SensitiveParameter]
	$value,
	bool $network,
	bool $needs_rotation = false,
	?string $action_override = null
) {
	return _wp_secrets_get_provider()->set( $name, $value, $network, $needs_rotation, $action_override );
}