Advertisements

delete_transient

Definition:
function delete_transient( $transient ) {}

Delete a transient.

Parameters

  • string $transient: Transient name. Expected to not be SQL-escaped.

Return values

returns:true if successful, false otherwise

Defined actions

  • delete_transient_’.$transient
    do_action( 'delete_transient_' . $transient, $transient );
  • deleted_transient
    do_action( 'deleted_transient', $transient );

Source code

function delete_transient( $transient ) {

	global $_wp_using_ext_object_cache;



	do_action( 'delete_transient_' . $transient, $transient );



	if ( $_wp_using_ext_object_cache ) {

		$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;

}

816

Advertisements

No comments yet... Be the first to leave a reply!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: