^ 回到顶部
  • 人生没有定律,每个人都有自己的节奏
  • 本站wordpress建站教程均通过实践后发布,希望对你有帮助
  • 希望你的坚持,都是因为热爱,而不是因为不甘心
  • 5年wordpress建站经验,5星服务品质
  • 那些不愿意让你吃亏的人,才是真正值得你深交的人,也是值得你付出时间的人
  • 阿里云1核2g仅需102元/年,今日10点开抢

wordpress函数delete_site_transient()用法示例

delete_site_transient( string $transient )

Delete a site transient.


描述


参数

$transient

(string)
(Required)
Transient name. Expected to not be SQL-escaped.


返回值

(bool) True if successful, false otherwise


源代码

File: wp-includes/option.php

function delete_site_transient( $transient ) {

	/**
	 * Fires immediately before a specific site transient is deleted.
	 *
	 * The dynamic portion of the hook name, `$transient`, refers to the transient name.
	 *
	 * @since 3.0.0
	 *
	 * @param string $transient Transient name.
	 */
	do_action( "delete_site_transient_{$transient}", $transient );

	if ( wp_using_ext_object_cache() ) {
		$result = wp_cache_delete( $transient, 'site-transient' );
	} else {
		$option_timeout = '_site_transient_timeout_' . $transient;
		$option = '_site_transient_' . $transient;
		$result = delete_site_option( $option );
		if ( $result )
			delete_site_option( $option_timeout );
	}
	if ( $result ) {

		/**
		 * Fires after a transient is deleted.
		 *
		 * @since 3.0.0
		 *
		 * @param string $transient Deleted transient name.
		 */
		do_action( 'deleted_site_transient', $transient );
	}

	return $result;
}

更新日志

Version 描述
2.9.0 Introduced.

相关函数

Uses

  • wp-includes/cache.php:
    wp_cache_delete()
  • wp-includes/load.php:
    wp_using_ext_object_cache()
  • wp-includes/plugin.php:
    do_action()
  • wp-includes/option.php:
    delete_site_option()
  • wp-includes/option.php:
    delete_site_transient_{$transient}
  • wp-includes/option.php:
    deleted_site_transient
  • Show 1 more use
    Hide more uses


Used By

  • wp-includes/update.php:
    wp_clean_update_cache()
  • wp-admin/includes/class-core-upgrader.php:
    Core_Upgrader::upgrade()
  • wp-admin/includes/theme.php:
    delete_theme()
  • wp-admin/includes/plugin-install.php:
    install_plugin_install_status()
  • wp-admin/includes/plugin.php:
    wp_clean_plugins_cache()
  • wp-admin/includes/update-core.php:
    update_core()
  • wp-includes/theme.php:
    wp_clean_themes_cache()
  • Show 2 more used by
    Hide more used by


User Contributed Notes

让小雨知道,这篇文章帮到了你
扫码关注微信公众号zs40086(微搜片)随时随地微信看片,抢先福利电影等你来

热门推荐

如有疑问,请前往问答中心反馈!

反馈