PHP Класс The_SEO_Framework\Transients

Generates, stores and deletes common transients.
С версии: 2.7.1
Наследование: extends Sitemaps
Показать файл Открыть проект

Защищенные свойства (Protected)

Свойство Тип Описание
$auto_description_transient The Automatic Description transient name.
$ld_json_transient The LD+Json script transient name.
$sitemap_transient The sitemap transient name.
$theme_doing_it_right_transient The Theme is doing the Title right transient name

Открытые методы

Метод Описание
delete_auto_description_frontpage_transient ( string $old_option ) : string Delete transient for the automatic description for blog on save request.
delete_auto_description_transient ( mixed $page_id, string $taxonomy = '', string $type = null ) : boolean Delete transient for the automatic description on requests.
delete_auto_description_transients_term ( integer $term_id, integer $tt_id, string $taxonomy, mixed $deleted_term = '' ) Delete transient on term save/deletion.
delete_front_ld_json_transient ( ) : boolean Flushes the home page LD+Json transient.
delete_ld_json_transient ( mixed $page_id, string $taxonomy = '', string | null $type = null ) : boolean Delete transient for the LD+Json scripts on requests.
delete_sitemap_transient ( ) : boolean Delete transient for sitemap on requests.
delete_sitemap_transient_permalink_updated ( ) : boolean Checks whether the permalink structure is updated.
delete_theme_dir_transient ( string | object $value = null, array | object | null $options = null ) : boolean Delete transient for the Theme doing it Right bool on special requests.
delete_transients_author ( integer $user_id ) Delete transient on profile save.
delete_transients_post ( integer $post_id ) : boolean | null Delete transient on post save.
generate_cache_key ( integer | string | boolean $page_id, string $taxonomy = '', string $type = null ) : string Generate transient key based on query vars.
generate_front_page_cache_key ( string $type = '' ) : string Returns the front page partial transient key.
get_transient ( string $transient ) : mixed | boolean Get the value of the transient.
set_theme_dir_transient ( $dir = null ) Sets transient for Theme doing it Right.
set_transient ( string $transient, string $value, integer $expiration = '' ) Set the value of the transient.
setup_auto_description_transient ( integer | string | boolean $page_id, string $taxonomy = '', strgin $type = null ) Setup vars for transients which require $page_id.
setup_ld_json_transient ( integer | string | boolean $page_id, string $taxonomy = '', string | null $type = null ) Setup vars for transients which require $page_id.
setup_transient_names ( ) Setup vars for general site transients.

Защищенные методы

Метод Описание
__construct ( ) Constructor, load parent constructor and set up caches.
add_cache_key_suffix ( $key = '' ) : string Adds cache key suffix based on blog id and locale.
generate_taxonomial_cache_key ( integer $page_id = '', string $taxonomy = '' ) : string Generates Cache key for taxonomial archives.

Описание методов

__construct() защищенный Метод

Constructor, load parent constructor and set up caches.
protected __construct ( )

add_cache_key_suffix() защищенный Метод

Adds cache key suffix based on blog id and locale.
С версии: 2.7.0
С версии: 2.7.1 $locale is now static. $key may now be empty.
protected add_cache_key_suffix ( $key = '' ) : string
Результат string the cache key.

delete_auto_description_frontpage_transient() публичный Метод

Returns old option, since that's passed for sanitation within WP Core.
С версии: 2.3.3
public delete_auto_description_frontpage_transient ( string $old_option ) : string
$old_option string The previous blog description option.
Результат string Previous option.

delete_auto_description_transient() публичный Метод

Delete transient for the automatic description on requests.
С версии: 2.3.3
public delete_auto_description_transient ( mixed $page_id, string $taxonomy = '', string $type = null ) : boolean
$page_id mixed The page ID or identifier.
$taxonomy string The tt name.
$type string The Post Type
Результат boolean true

delete_auto_description_transients_term() публичный Метод

Delete transient on term save/deletion.
С версии: 2.3.3
public delete_auto_description_transients_term ( integer $term_id, integer $tt_id, string $taxonomy, mixed $deleted_term = '' )
$term_id integer The Term ID
$tt_id integer The Term Taxonomy ID.
$taxonomy string The Taxonomy type.
$deleted_term mixed Copy of the already-deleted term. Unused.

delete_front_ld_json_transient() публичный Метод

Flushes the home page LD+Json transient.
С версии: 2.6.0
public delete_front_ld_json_transient ( ) : boolean
Результат boolean Whether it's flushed on current call.

delete_ld_json_transient() публичный Метод

Delete transient for the LD+Json scripts on requests.
С версии: 2.4.2
public delete_ld_json_transient ( mixed $page_id, string $taxonomy = '', string | null $type = null ) : boolean
$page_id mixed The page ID or identifier.
$taxonomy string The tt name.
$type string | null The post type.
Результат boolean true

delete_sitemap_transient() публичный Метод

Also ping search engines.
С версии: 2.2.9
public delete_sitemap_transient ( ) : boolean
Результат boolean true

delete_theme_dir_transient() публичный Метод

Delete transient for the Theme doing it Right bool on special requests.
С версии: 2.5.2
С версии: 2.7.0
public delete_theme_dir_transient ( string | object $value = null, array | object | null $options = null ) : boolean
$value string | object The theme directory stylesheet location, or either WP_Theme/WP_Upgrader instance.
$options array | object | null If set, the update options array or the Old theme WP_Theme instance.
Результат boolean True on success, false on failure.

delete_transients_author() публичный Метод

Delete transient on profile save.
С версии: 2.6.4
public delete_transients_author ( integer $user_id )
$user_id integer The User ID that has been updated.

delete_transients_post() публичный Метод

Delete transient on post save.
С версии: 2.2.9
public delete_transients_post ( integer $post_id ) : boolean | null
$post_id integer The Post ID that has been updated.
Результат boolean | null True when sitemap is flushed. False on revision. Null when sitemaps are deactivated.

generate_cache_key() публичный Метод

Generate transient key based on query vars.
С версии: 2.3.3
С версии: 2.6.0 Refactored.
public generate_cache_key ( integer | string | boolean $page_id, string $taxonomy = '', string $type = null ) : string
$page_id integer | string | boolean the Taxonomy or Post ID.
$taxonomy string The Taxonomy name.
$type string The Post Type
Результат string The generated page id key.

generate_front_page_cache_key() публичный Метод

Returns the front page partial transient key.
public generate_front_page_cache_key ( string $type = '' ) : string
$type string
Результат string the front page transient key.

generate_taxonomial_cache_key() защищенный Метод

Generates Cache key for taxonomial archives.
С версии: 2.6.0
protected generate_taxonomial_cache_key ( integer $page_id = '', string $taxonomy = '' ) : string
$page_id integer The taxonomy or page ID.
$taxonomy string The taxonomy name.
Результат string The Taxonomial Archive cache key.

get_transient() публичный Метод

If the transient does not exists, does not have a value or has expired, or transients have been disabled through a constant, then the transient will be false.
С версии: 2.6.0
public get_transient ( string $transient ) : mixed | boolean
$transient string Transient name. Expected to not be SQL-escaped.
Результат mixed | boolean Value of the transient. False on failure or non existing transient.

set_theme_dir_transient() публичный Метод

Sets transient for Theme doing it Right.
С версии: 2.5.2
С версии: 2.7.0 Will always set "doing it wrong" transient, even if it was "doing it right" earlier.
public set_theme_dir_transient ( $dir = null )

set_transient() публичный Метод

. Prevents setting of transients when they're disabled.
С версии: 2.6.0
public set_transient ( string $transient, string $value, integer $expiration = '' )
$transient string Transient name. Expected to not be SQL-escaped.
$value string Transient value. Expected to not be SQL-escaped.
$expiration integer Optional Transient expiration date, optional. Expected to not be SQL-escaped.

setup_auto_description_transient() публичный Метод

Setup vars for transients which require $page_id.
С версии: 2.3.3
public setup_auto_description_transient ( integer | string | boolean $page_id, string $taxonomy = '', strgin $type = null )
$page_id integer | string | boolean the Taxonomy or Post ID. If false it will generate for the blog page.
$taxonomy string The taxonomy name.
$type strgin The Post Type

setup_ld_json_transient() публичный Метод

Setup vars for transients which require $page_id.
С версии: 2.3.3
public setup_ld_json_transient ( integer | string | boolean $page_id, string $taxonomy = '', string | null $type = null )
$page_id integer | string | boolean the Taxonomy or Post ID. If false it will generate for the blog page.
$taxonomy string The taxonomy name.
$type string | null The post type.

setup_transient_names() публичный Метод

Setup vars for general site transients.
С версии: 2.3.3
С версии: 2.7.1 Added locale suffix.

Описание свойств

$auto_description_transient защищенное свойство

The Automatic Description transient name.
С версии: 2.3.3
protected $auto_description_transient

$ld_json_transient защищенное свойство

The LD+Json script transient name.
С версии: 2.3.3
protected $ld_json_transient

$sitemap_transient защищенное свойство

The sitemap transient name.
С версии: 2.2.9
protected $sitemap_transient

$theme_doing_it_right_transient защищенное свойство

The Theme is doing the Title right transient name
С версии: 2.5.2
protected $theme_doing_it_right_transient