PHP 클래스 Jetpack_SEO_Titles, jetpack

파일 보기 프로젝트 열기: automattic/jetpack 1 사용 예제들

공개 메소드들

메소드 설명
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.