PHP 클래스 The_SEO_Framework\Post_Data

Holds Post data.
부터: 2.1.6
상속: extends Detect
파일 보기 프로젝트 열기: sybrew/the-seo-framework

공개 메소드들

메소드 설명
fetch_excerpt ( integer $the_id = '', integer $tt_id = '' ) : string | empty Fetches excerpt from post excerpt or fetches the full post content.
get_excerpt_by_id ( string $excerpt = '', integer $the_id = '', integer $tt_id = '' ) : string Fetches or parses the excerpt of the post.
get_latest_post_id ( ) : integer Fetch latest public post ID.
get_post_content ( integer $id ) : string Fetches Post content.
inpost_seo_save ( integer $post_id, object $post ) : mixed Save the SEO settings when we save a post or page.
save_custom_fields ( array $data, string $nonce_action, string $nonce_name, WP_Post | integer $post ) : mixed Save post meta / custom field data for a post or page.
uses_page_builder ( integer $post_id ) : boolean Determines whether the post has a page builder attached to it.

보호된 메소드들

메소드 설명
__construct ( ) Constructor, load parent constructor
fetch_post_by_id ( integer $the_id = '', integer $tt_id = '', mixed $output = ARRAY_A ) : empty | array Returns Post Array from ID.

메소드 상세

__construct() 보호된 메소드

Constructor, load parent constructor
protected __construct ( )

fetch_excerpt() 공개 메소드

Determines if a page builder is used to return an empty string. Does not sanitize output.
부터: 2.5.2
부터: 2.6.6 Detects Page builders.
public fetch_excerpt ( integer $the_id = '', integer $tt_id = '' ) : string | empty
$the_id integer The Post ID.
$tt_id integer The Taxonomy Term ID.
리턴 string | empty excerpt.

fetch_post_by_id() 보호된 메소드

Also returns latest post from blog or archive if applicable.
부터: 2.6.0
부터: 2.6.6 Added $output parameter.
protected fetch_post_by_id ( integer $the_id = '', integer $tt_id = '', mixed $output = ARRAY_A ) : empty | array
$the_id integer The Post ID.
$tt_id integer The Taxonomy Term ID
$output mixed The value type to return. Accepts OBJECT, ARRAY_A, or ARRAY_N
리턴 empty | array The Post Array.

get_excerpt_by_id() 공개 메소드

Fetches or parses the excerpt of the post.
부터: 1.0.0
public get_excerpt_by_id ( string $excerpt = '', integer $the_id = '', integer $tt_id = '' ) : string
$excerpt string the Excerpt.
$the_id integer The Post ID.
$tt_id integer The Taxonomy Term ID.
리턴 string The escaped Excerpt.

get_latest_post_id() 공개 메소드

Fetch latest public post ID.
부터: 2.4.3
public get_latest_post_id ( ) : integer
리턴 integer Latest Post ID.

get_post_content() 공개 메소드

Fetches Post content.
부터: 2.6.0
public get_post_content ( integer $id ) : string
$id integer The post ID.
리턴 string The post content.

inpost_seo_save() 공개 메소드

Some values get sanitized, the rest are pulled from identically named subkeys in the $_POST['autodescription'] array.
부터: 2.0.0
public inpost_seo_save ( integer $post_id, object $post ) : mixed
$post_id integer Post ID.
$post object Post object.
리턴 mixed Returns post id if permissions incorrect, null if doing autosave, ajax or future post, false if update or delete failed, and true on success.

save_custom_fields() 공개 메소드

It verifies the nonce, then checks we're not doing autosave, ajax or a future post request. It then checks the current user's permissions, before finally* either updating the post meta, or deleting the field if the value was not truthy. By passing an array of fields => values from the same metabox (and therefore same nonce) into the $data argument, repeated checks against the nonce, request and permissions are avoided.
부터: 2.0.0
public save_custom_fields ( array $data, string $nonce_action, string $nonce_name, WP_Post | integer $post ) : mixed
$data array Key/Value pairs of data to save in '_field_name' => 'value' format.
$nonce_action string Nonce action for use with wp_verify_nonce().
$nonce_name string Name of the nonce to check for permissions.
$post WP_Post | integer Post object or ID.
리턴 mixed Return null if permissions incorrect, doing autosave, ajax or future post, false if update or delete failed, and true on success.

uses_page_builder() 공개 메소드

Doesn't use plugin detection features as some builders might be incorporated within themes. Detects the following builders: - Divi Builder by Elegant Themes - Visual Composer by WPBakery - Page Builder by SiteOrigin - Beaver Builder by Fastline Media
부터: 2.6.6
public uses_page_builder ( integer $post_id ) : boolean
$post_id integer
리턴 boolean