PHP 클래스 The_SEO_Framework\Generate_Description

Generates Description SEO data based on content.
부터: 2.7.1
상속: extends Generate
파일 보기 프로젝트 열기: sybrew/the-seo-framework

공개 메소드들

메소드 설명
add_description_additions ( integer $id = '', object | string $term = '' ) : boolean Determines whether to add description additions. (╯°□°)╯︵ ┻━┻
description_from_custom_field ( array $args = [], boolean $escape = true ) : string | mixed Creates description from custom fields.
escape_description ( string $description = '' ) : string Escapes and beautifies description.
generate_description ( string $description = '', array $args = [] ) : string Creates description. Base function.
generate_description_additions ( integer $id = '', object | empty $term = '', boolean $ignore = false ) : array Generates description additions.
generate_description_from_id ( array $args = [], boolean $escape = true ) : string Generates description from content while parsing filters.
generate_description_title ( integer $id = '', void | object $term = '', boolean $page_on_front = false ) : string Generates the Title for description.
generate_excerpt ( integer | string $page_id, object | null $term = '', integer $max_char_length = 155 ) Generates the excerpt.
generate_home_page_description ( boolean $custom_field = true, boolean $escape = true ) : string Generates the home page description.
get_description_separator ( ) : string Gets Description Separator.
parse_description_args ( array $args = [], array $defaults = [], boolean $get_defaults = false ) : array Parses and sanitizes description arguments.
reparse_description_args ( array $args = [] ) : array Reparses description args.
trim_excerpt ( string $excerpt, integer $excerpt_length, integer $max_char_length ) : string Trims the excerpt by word and determines sentence stops.

보호된 메소드들

메소드 설명
__construct ( ) Constructor, loads parent constructor.
generate_the_description ( array $args, boolean $escape = true ) : string Generates description from content.
get_custom_archive_description ( array $args ) : string Fetch Archive Description from custom field.
get_custom_homepage_description ( array $args ) : string Fetches HomePage Description from custom field.
get_custom_singular_description ( integer $id ) : string Fetches Singular Description from custom field.

메소드 상세

__construct() 보호된 메소드

Constructor, loads parent constructor.
protected __construct ( )

add_description_additions() 공개 메소드

Determines whether to add description additions. (╯°□°)╯︵ ┻━┻
부터: 2.6.0
부터: 2.7.0 Removed cache. Whether an excerpt is available is no longer part of this check.
public add_description_additions ( integer $id = '', object | string $term = '' ) : boolean
$id integer The current page or post ID.
$term object | string The current Term.
리턴 boolean Whether to add description additions.

description_from_custom_field() 공개 메소드

Creates description from custom fields.
부터: 2.4.1
public description_from_custom_field ( array $args = [], boolean $escape = true ) : string | mixed
$args array description args : { @param int $id the term or page id. @param string $taxonomy taxonomy name. @param bool $is_home We're generating for the home page. }
$escape boolean Escape the output if true.
리턴 string | mixed The description.

escape_description() 공개 메소드

Escapes and beautifies description.
부터: 2.5.2
public escape_description ( string $description = '' ) : string
$description string The description to escape and beautify.
리턴 string Escaped and beautified description.

generate_description() 공개 메소드

Creates description. Base function.
부터: 1.0.0
public generate_description ( string $description = '', array $args = [] ) : string
$description string The optional description to simply parse.
$args array description args : { @param int $id the term or page id. @param string $taxonomy taxonomy name. @param bool $is_home We're generating for the home page. @param bool $get_custom_field Do not fetch custom title when false. @param bool $social Generate Social Description when true. }
리턴 string The description

generate_description_additions() 공개 메소드

Generates description additions.
부터: 2.6.0
public generate_description_additions ( integer $id = '', object | empty $term = '', boolean $ignore = false ) : array
$id integer The post or term ID
$term object | empty The term object
$ignore boolean Whether to ignore options and filters.
리턴 array : { $title => The title $on => The word separator $blogname => The blogname $sep => The separator }

generate_description_from_id() 공개 메소드

Generates description from content while parsing filters.
부터: 2.3.3
public generate_description_from_id ( array $args = [], boolean $escape = true ) : string
$args array description args : { @param int $id the term or page id. @param string $taxonomy taxonomy name. @param bool $is_home We're generating for the home page. @param bool $get_custom_field Do not fetch custom title when false. @param bool $social Generate Social Description when true. }
$escape boolean Escape output when true.
리턴 string $output The description.

generate_description_title() 공개 메소드

Generates the Title for description.
부터: 2.5.2
public generate_description_title ( integer $id = '', void | object $term = '', boolean $page_on_front = false ) : string
$id integer The page ID.
$term void | object The term object.
$page_on_front boolean If front page.
리턴 string The description title.

generate_excerpt() 공개 메소드

Generates the excerpt.
부터: 2.3.4
public generate_excerpt ( integer | string $page_id, object | null $term = '', integer $max_char_length = 155 )
$page_id integer | string required : The Page ID
$term object | null The Taxonomy Term.
$max_char_length integer The maximum excerpt char length.

generate_home_page_description() 공개 메소드

Generates the home page description.
부터: 2.6.0
public generate_home_page_description ( boolean $custom_field = true, boolean $escape = true ) : string
$custom_field boolean whether to check the Custom Field.
$escape boolean Whether to escape the output.
리턴 string The description.

generate_the_description() 보호된 메소드

Generates description from content.
부터: 2.6.0
protected generate_the_description ( array $args, boolean $escape = true ) : string
$args array description args : { @param int $id the term or page id. @param string $taxonomy taxonomy name. @param bool $is_home We're generating for the home page. @param bool $get_custom_field Do not fetch custom title when false. @param bool $social Generate Social Description when true. }
$escape boolean Whether to escape the description. NOTE: When this is false, be sure to trim the output.
리턴 string The description.

get_custom_archive_description() 보호된 메소드

Fetch Archive Description from custom field.
부터: 2.6.0 Use $this->description_from_custom_field() instead.
protected get_custom_archive_description ( array $args ) : string
$args array
리턴 string The Description

get_custom_homepage_description() 보호된 메소드

Fetches HomePage Description from custom field.
부터: 2.6.0 Use $this->description_from_custom_field() instead.
protected get_custom_homepage_description ( array $args ) : string
$args array Description args.
리턴 string The Description

get_custom_singular_description() 보호된 메소드

Fetches Singular Description from custom field.
부터: 2.6.0 Use $this->description_from_custom_field() instead.
protected get_custom_singular_description ( integer $id ) : string
$id integer The page ID.
리턴 string The Description

get_description_separator() 공개 메소드

Applies filters 'the_seo_framework_description_separator' : string
부터: 2.3.9
public get_description_separator ( ) : string
리턴 string The Separator, unescaped.

parse_description_args() 공개 메소드

Parses and sanitizes description arguments.
부터: 2.5.0
public parse_description_args ( array $args = [], array $defaults = [], boolean $get_defaults = false ) : array
$args array required The passed arguments.
$defaults array The default arguments.
$get_defaults boolean Return the default arguments. Ignoring $args.
리턴 array $args parsed args.

reparse_description_args() 공개 메소드

Reparses description args.
부터: 2.6.0
public reparse_description_args ( array $args = [] ) : array
$args array required The passed arguments.
리턴 array $args parsed args.

trim_excerpt() 공개 메소드

Trims the excerpt by word and determines sentence stops.
부터: 2.6.0
public trim_excerpt ( string $excerpt, integer $excerpt_length, integer $max_char_length ) : string
$excerpt string The untrimmed excerpt.
$excerpt_length integer The current excerpt length.
$max_char_length integer At what point to shave off the excerpt.
리턴 string The trimmed excerpt.