函数原型:
delete_transient( string $transient ): bool
删除临时值。
参数说明:
$transient,临时值名称。
函数源码:
function delete_transient( $transient ) {
do_action( "delete_transient_{$transient}", $transient );
if ( wp_using_ext_object_cache() || wp_installing() ) {
$result = wp_cache_delete( $transient, 'transient' );
} else {
$option_timeout = '_transient_timeout_' . $transient;
$option = '_transient_' . $transient;
$result = delete_option( $option );
if ( $result ) {
delete_option( $option_timeout );
}
}
if ( $result ) {
do_action( 'deleted_transient', $transient );
}
return $result;
}
包含钩子:
do_action( 'deleted_transient', string $transient )
do_action( "delete_transient_{$transient}", string $transient )
-
WordPress函数:register_uninstall_hook 设置插件的卸载回调函数WordPress函数:register_uninstall_hook 设置插件的卸载回调函数
-
WordPress函数:wp_trash_post 移动文章到回收站WordPress函数:wp_trash_post 移动文章到回收站
-
WordPress函数:wp_update_post 更新修改文章WordPress函数:wp_update_post 更新修改文章
-
WordPress函数:wp_trash_post_comments 移动文章评论到垃圾站WordPress函数:wp_trash_post_comments 移动文章评论到垃圾站
-
WordPress函数:wp_delete_attachment 删除附件WordPress函数:wp_delete_attachment 删除评论
-
WordPress函数:wp_update_user 更新用户信息WordPress函数:wp_update_user 更新用户信息
暂无评论,抢个沙发...