PHP Класс Jetpack_SEO_Titles, jetpack

Показать файл Открыть проект Примеры использования класса

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

Метод Описание
are_valid_title_formats ( array $title_formats ) : boolean Checks if a given format conforms to predefined SEO title templates.
get_allowed_tokens ( ) : array Returns tokens that are currently supported for each page type.
get_custom_title ( string $default_title = '' ) : string Used to modify the default title with custom SEO title.
get_custom_title_formats ( ) : array Retrieves custom title formats from site option.
get_date_for_title ( ) : string Returns the value that should be used as a replacement for the date token, depending on the archive path specified.
get_page_type ( ) : string | boolean Returns page type for current page. We need this helper in order to determine what user defined title format should be used for custom title.
get_token_value ( string $token_name ) : string Returns string value for given token.
is_conflicted_theme ( ) : boolean Checks if current theme is defining custom title that won't work nicely with our custom SEO title override.
update_title_formats ( array $new_formats ) : array Combines the previous values of title formats, stored as array in site options, with the new values that are provided.

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

are_valid_title_formats() публичный статический метод

Every format type and token must be whitelisted.
См. также: get_allowed_tokens()
public static are_valid_title_formats ( array $title_formats ) : boolean
$title_formats array Template of SEO title to check.
Результат boolean True if the formats are valid, false otherwise.

get_allowed_tokens() публичный статический метод

Returns tokens that are currently supported for each page type.
public static get_allowed_tokens ( ) : array
Результат array Array of allowed token strings.

get_custom_title() публичный статический метод

Used to modify the default title with custom SEO title.
public static get_custom_title ( string $default_title = '' ) : string
$default_title string Default title for current page.
Результат string Custom title with replaced tokens or default title.

get_custom_title_formats() публичный статический метод

Retrieves custom title formats from site option.
public static get_custom_title_formats ( ) : array
Результат array Array of custom title formats, or empty array.

get_date_for_title() публичный статический метод

Returns the value that should be used as a replacement for the date token, depending on the archive path specified.
public static get_date_for_title ( ) : string
Результат string Token replacement for a given date, or empty string if no date is specified.

get_page_type() публичный статический метод

Returns page type for current page. We need this helper in order to determine what user defined title format should be used for custom title.
public static get_page_type ( ) : string | boolean
Результат string | boolean Type of current page or false if unsupported.

get_token_value() публичный статический метод

Returns string value for given token.
public static get_token_value ( string $token_name ) : string
$token_name string The token name value that should be replaced.
Результат string Token replacement for current site, or empty string for unknown token name.

is_conflicted_theme() публичный статический метод

Checks if current theme is defining custom title that won't work nicely with our custom SEO title override.
public static is_conflicted_theme ( ) : boolean
Результат boolean True if current theme sets custom title, false otherwise.

update_title_formats() публичный статический метод

Combines the previous values of title formats, stored as array in site options, with the new values that are provided.
public static update_title_formats ( array $new_formats ) : array
$new_formats array Array containing new title formats.
Результат array $result Array of updated title formats, or empty array if no update was performed.