PHP Класс The_SEO_Framework\Post_Data

Holds Post data.
С версии: 2.1.6
Наследование: extends Detect
Показать файл Открыть проект

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

Метод Описание
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