Overview

Namespaces

  • Varunsridharan
    • WordPress

Classes

  • Transient_Api
  • Overview
  • Namespace
  • Class

Class Transient_Api

Class Transient_WP_Api

Namespace: Varunsridharan\WordPress
Package: Varunsridharan\WordPress
Author: Varun Sridharan varunsridharan23@gmail.com
Since: 1.0
Located at src/Transient_Api.php
Methods summary
public
# __construct( array $options = array() )

Transient_Api constructor.

Transient_Api constructor.

Parameters

$options
protected boolean|mixed
# option( $key, boolean $default = false )

Parameters

$key
$default

Returns

boolean|mixed
public mixed
# key( string $key = '', boolean $is_option = false )

Returns a Unique Key.

Returns a Unique Key.

Parameters

$key
$is_option

Returns

mixed
public string
# get_key( string $key = '', boolean $is_option = false )

Returns Key Based on Requirement.

Returns Key Based on Requirement.

Parameters

$key
$is_option

Returns

string
protected string
# validate_length( string $key = '' )

Validates Key Length if key lenght exceeds it will md5 or returns the orginal key

Validates Key Length if key lenght exceeds it will md5 or returns the orginal key

Parameters

$key

Returns

string
protected boolean
# check_length( string $key = '' )

Returns if key is in correct length if Type set to option then it uses $this->option_limit for char limit or uses $this->transient_limit for char limit

Returns if key is in correct length if Type set to option then it uses $this->option_limit for char limit or uses $this->transient_limit for char limit

Parameters

$key

Returns

boolean
protected boolean
# wp_add_option( string $key = '', mixed $value = '', string $autoload = 'no' )

Adds Given value to db using add_option

Adds Given value to db using add_option

Parameters

$key
$value
$autoload

Returns

boolean
protected boolean
# wp_update_option( string $key = '', mixed $value = '', string $autoload = 'no' )

Updates Given value to db using update_option

Updates Given value to db using update_option

Parameters

$key
$value
$autoload

Returns

boolean
protected boolean
# wp_delete_option( string $key = '' )

Deletes a given option

Deletes a given option

Parameters

$key

Returns

boolean
protected mixed|
# wp_get_option( string $key = '', boolean $default = false )

Gets An Option From DB

Gets An Option From DB

Parameters

$key
$default

Returns

mixed|
protected boolean
# wp_set_transient( $transient, $value, integer $expiration = 0 )

Sets an transient using Transient API In WP

Sets an transient using Transient API In WP

Parameters

$transient
$value
$expiration

Returns

boolean
protected mixed
# wp_get_transient( $transient )

Gets an transient using Transient API In WP

Gets an transient using Transient API In WP

Parameters

$transient

Returns

mixed
protected boolean
# wp_delete_transient( $transient )

Deletes an transient using Transient API In WP

Deletes an transient using Transient API In WP

Parameters

$transient

Returns

boolean
protected string
# get_version_key( string $key = '' )

Returns Version Key.

Returns Version Key.

Parameters

$key

Returns

string
protected boolean|mixed
# validate_version( $value, string $type = '' )

Validates If Saved Version is same as in the class version.

Validates If Saved Version is same as in the class version.

Parameters

$value
$type

Returns

boolean|mixed
public static Varunsridharan\WordPress\Transient_Api
# instance( boolean $key = false, array $args = array() )

Parameters

$key
$args

Returns

Varunsridharan\WordPress\Transient_Api
public mixed
# force_set( string $key = '', string $value = '', string $expiry = '' )

Parameters

$key
$value
$expiry

Returns

mixed
public boolean
# update_option( $key, $value, string $status = '' )

Parameters

$key
$value
$status

Returns

boolean
public boolean
# delete_transient( $_key )

Parameters

$_key

Returns

boolean
public boolean
# set_transient( $_key, $value, integer $expiry = 0 )

Parameters

$_key
$value
$expiry

Returns

boolean
public boolean
# set( string $key = '', string $value = '', string $expiry = '' )

Parameters

$key
$value
$expiry

Returns

boolean
public boolean
# set_option( $_key, $value, string $status = '' )

Parameters

$_key
$value
$status

Returns

boolean
public mixed
# get( string $key = '' )

Parameters

$key

Returns

mixed
public boolean|mixed
# get_option( $_key )

Parameters

$_key

Returns

boolean|mixed
public boolean|mixed
# get_transient( $_key )

Parameters

$_key

Returns

boolean|mixed
public boolean|
# delete( $key )

Parameters

$key

Returns

boolean|
public boolean
# delete_option( $_key )

Parameters

$_key

Returns

boolean
public boolean
# update( $key, string $value = '', string $expiry = '' )

Parameters

$key
$value
$expiry

Returns

boolean
protected boolean
# delete_version_issue( $key, string $type = '' )

Deletes if cache has any issues.

Deletes if cache has any issues.

Parameters

$key
$type

Returns

boolean
Properties summary
protected static array $_instances

_instances

_instances

# array()
protected array $options

Stores All Options.

Stores All Options.

# array()
API documentation generated by ApiGen