delete_transient() – Deletes a transient.

You appear to be a bot. Output may be restricted

Description

Deletes a transient.

Usage

$bool = delete_transient( $transient );

Parameters

$transient
( string ) required – Transient name. Expected to not be SQL-escaped.

Returns

bool True if the transient was deleted, false otherwise.

Source

File name: wordpress/wp-includes/option.php


Lines:

1 to 43 of 43
function delete_transient( $transient ) {

  
/**
 * Fires immediately before a specific 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_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 ) {

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

  return $result;
}
 

 View on GitHub View on Trac