PHP Класс The_SEO_Framework\Doing_It_Right

Adds data in a column to edit.php and edit-tags.php Shows you if you're doing the SEO right.
С версии: 2.7.1
Наследование: extends Search
Показать файл Открыть проект

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

Метод Описание
add_column ( array $columns ) : array Adds SEO column on edit(-tags).php
add_post_state ( array $states = [], object $post ) Adds post states in post/page edit.php query
get_the_seo_bar_classes ( ) : array Returns an array of the classes used for CSS within The SEO Bar.
get_the_seo_bar_i18n ( ) : array Returns an array of the i18n notices for The SEO Bar.
init_columns ( object | empty $screen = '', boolean $doing_ajax = false ) Initializes columns
init_columns_ajax ( ) AJAX wrapper for $this->init_columns
post_state ( ) Add post state on edit.php to the page or post that has been altered.
post_status ( integer $post_id = '', string $type = 'inpost', boolean $echo = false ) : string | void Renders post status. Caches the output.
seo_bar ( string $column, integer $post_id, string $tax_id = '' ) Echo's the SEO Bar.
seo_bar_ajax ( string $column, integer $post_id, string $tax_id = '' ) Echo's the SEO column in edit screens on Ajax call.

Защищенные методы

Метод Описание
__construct ( ) Constructor, load parent constructor.
get_the_seo_bar_description_length_warning ( integer $desc_len, string $class ) : array Description Length notices.
get_the_seo_bar_description_words_warning ( string $description, string $class ) : string Calculates the word count and returns a warning with the words used.
get_the_seo_bar_title_length_warning ( integer $tit_len, string $class ) : array Title Length notices.
get_the_seo_bar_wrap ( string $content, boolean $is_term, integer | null $ajax_id = null ) : string Wrap the SEO bar.
pill_the_seo_bar ( ) : boolean Whether to square or pill the seo bar.
post_status_special ( string $context, string $symbol = '?', $color = 'unknown', $is_term = '', integer | null $ajax_id = null, boolean $echo = false ) : string | void Wrap a single-line block for the SEO bar, showing special statuses.
the_seo_bar_archive_notice ( array $args ) : string Render the SEO bar archive block and notice.
the_seo_bar_archive_robots_options ( string $type ) : boolean Checks whether global index/archive/follow options are checked for archives.
the_seo_bar_blocked ( array $args ) : string Render the SEO bar when the page/term is blocked.
the_seo_bar_data ( array $args ) : array Fetch the post or term data for The SEO Bar, structured and cached.
the_seo_bar_description_notice ( array $args ) : string Render the SEO bar description block and notice.
the_seo_bar_follow_notice ( array $args ) : string Render the SEO bar follow block and notice.
the_seo_bar_index_notice ( array $args ) : string Render the SEO bar index block and notice.
the_seo_bar_page ( array $args ) : string Output the SEO bar for Terms and Taxonomies.
the_seo_bar_post_data ( array $args ) : array Fetch the post data for The SEO Bar.
the_seo_bar_redirect_notice ( array $args ) : string Render the SEO bar redirect block and notice.
the_seo_bar_term ( array $args ) : string Output the SEO bar for Terms and Taxonomies.
the_seo_bar_term_data ( array $args ) : array Fetch the term data for The SEO Bar.
the_seo_bar_title_notice ( array $args ) : string Render the SEO bar title block and notice.
wrap_the_seo_bar_block ( array $args ) : string Outputs a part of the SEO Bar based on parameters.

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

__construct() защищенный Метод

Initalizes columns and load post states.
protected __construct ( )

add_column() публичный Метод

Also determines where the column should be placed. Prefered before comments, then data, then tags. If neither found, it will add the column to the end.
С версии: 2.1.9
public add_column ( array $columns ) : array
$columns array The existing columns
Результат array $columns the column data

add_post_state() публичный Метод

Adds post states in post/page edit.php query
С версии: 2.1.0
public add_post_state ( array $states = [], object $post )
$states array The current post states array
$post object The Post Object.

get_the_seo_bar_classes() публичный Метод

Returns an array of the classes used for CSS within The SEO Bar.
С версии: 2.6.0
public get_the_seo_bar_classes ( ) : array
Результат array The class names.

get_the_seo_bar_description_length_warning() защищенный Метод

Description Length notices.
С версии: 2.6.0
protected get_the_seo_bar_description_length_warning ( integer $desc_len, string $class ) : array
$desc_len integer The Title length
$class string The current color class.
Результат array { notice => The notice, class => The class, }

get_the_seo_bar_description_words_warning() защищенный Метод

Only when count is over 3.
С версии: 2.6.0
protected get_the_seo_bar_description_words_warning ( string $description, string $class ) : string
$description string The Description with maybe words too many.
$class string The current color class.
Результат string The warning notice.

get_the_seo_bar_i18n() публичный Метод

Returns an array of the i18n notices for The SEO Bar.
С версии: 2.6.0
public get_the_seo_bar_i18n ( ) : array
Результат array The i18n sentences.

get_the_seo_bar_title_length_warning() защищенный Метод

Title Length notices.
С версии: 2.6.0
protected get_the_seo_bar_title_length_warning ( integer $tit_len, string $class ) : array
$tit_len integer The Title length
$class string The Current Title notification class.
Результат array { string $notice => The notice, string $class => The class, bool $but => Whether we should use but or and, }

get_the_seo_bar_wrap() защищенный Метод

If Ajax ID is set, a small jQuery script will also be output to reset the DOM element for the status bar hover.
С версии: 2.6.0
protected get_the_seo_bar_wrap ( string $content, boolean $is_term, integer | null $ajax_id = null ) : string
$content string The SEO Bar content.
$is_term boolean Whether the bar is for a term.
$ajax_id integer | null The unique Ajax ID to generate a small on-hover script for.
Результат string The SEO Bar wrapped.

init_columns() публичный Метод

Applies filter the_seo_framework_show_seo_column : Boolean Show the SEO column in edit.php
С версии: 2.1.9
public init_columns ( object | empty $screen = '', boolean $doing_ajax = false )
$screen object | empty WP_Screen
$doing_ajax boolean Whether we're doing an AJAX response.

init_columns_ajax() публичный Метод

AJAX wrapper for $this->init_columns
С версии: 2.6.0
public init_columns_ajax ( )

pill_the_seo_bar() защищенный Метод

Applies filters 'the_seo_framework_seo_bar_pill' : boolean
С версии: 2.6.0
protected pill_the_seo_bar ( ) : boolean
Результат boolean

post_state() публичный Метод

Add post state on edit.php to the page or post that has been altered.
С версии: 2.1.0
public post_state ( )

post_status() публичный Метод

Renders post status. Caches the output.
С версии: 2.1.9
С версии: 2.7.1 Third parameter `$echo` has been put into effect.
public post_status ( integer $post_id = '', string $type = 'inpost', boolean $echo = false ) : string | void
$post_id integer The Post ID or taxonomy ID.
$type string Is fetched on edit.php, inpost, taxonomies, etc.
$echo boolean Whether to echo the value. Does not eliminate return.
Результат string | void $content The post SEO status. Void if $echo is true.

post_status_special() защищенный Метод

Wrap a single-line block for the SEO bar, showing special statuses.
С версии: 2.6.0
protected post_status_special ( string $context, string $symbol = '?', $color = 'unknown', $is_term = '', integer | null $ajax_id = null, boolean $echo = false ) : string | void
$context string The hover/screenreader context.
$symbol string The single-character symbol.
$ajax_id integer | null The unique Ajax ID to generate a small on-hover script for this ID. May be Arbitrary.
$echo boolean Whether to echo the output.
Результат string | void The special block with wrap. Void if $echo is true.

seo_bar() публичный Метод

Echo's the SEO Bar.
С версии: 2.6.0
public seo_bar ( string $column, integer $post_id, string $tax_id = '' )
$column string the current column : If it's a taxonomy, this is empty
$post_id integer the post id : If it's a taxonomy, this is the column name
$tax_id string this is empty : If it's a taxonomy, this is the taxonomy id

seo_bar_ajax() публичный Метод

Echo's the SEO column in edit screens on Ajax call.
С версии: 2.1.9
public seo_bar_ajax ( string $column, integer $post_id, string $tax_id = '' )
$column string the current column : If it's a taxonomy, this is empty
$post_id integer the post id : If it's a taxonomy, this is the column name
$tax_id string this is empty : If it's a taxonomy, this is the taxonomy id

the_seo_bar_archive_notice() защищенный Метод

Render the SEO bar archive block and notice.
С версии: 2.6.0
protected the_seo_bar_archive_notice ( array $args ) : string
$args array
Результат string The SEO Bar Follow Block

the_seo_bar_archive_robots_options() защищенный Метод

Checks whether global index/archive/follow options are checked for archives.
С версии: 2.6.0
protected the_seo_bar_archive_robots_options ( string $type ) : boolean
$type string : 'noindex', 'nofollow', 'noarchive'
Результат boolean

the_seo_bar_blocked() защищенный Метод

Render the SEO bar when the page/term is blocked.
С версии: 2.6.0
protected the_seo_bar_blocked ( array $args ) : string
$args array { $is_term => bool, $redirect => bool, $noindex => bool, $post_i18n => string }
Результат string The SEO Bar

the_seo_bar_data() защищенный Метод

Fetch the post or term data for The SEO Bar, structured and cached.
С версии: 2.6.0
protected the_seo_bar_data ( array $args ) : array
$args array The term/post args.
Результат array $data { 'title' => $title, 'title_is_from_custom_field' => $title_is_from_custom_field, 'description' => $description, 'description_is_from_custom_field' => $description_is_from_custom_field, 'nofollow' => $nofollow, 'noarchive' => $noarchive }

the_seo_bar_description_notice() защищенный Метод

Render the SEO bar description block and notice.
С версии: 2.6.0
protected the_seo_bar_description_notice ( array $args ) : string
$args array
Результат string The SEO Bar Description Block

the_seo_bar_follow_notice() защищенный Метод

Render the SEO bar follow block and notice.
С версии: 2.6.0
protected the_seo_bar_follow_notice ( array $args ) : string
$args array
Результат string The SEO Bar Follow Block

the_seo_bar_index_notice() защищенный Метод

Render the SEO bar index block and notice.
С версии: 2.6.0
protected the_seo_bar_index_notice ( array $args ) : string
$args array
Результат string The SEO Bar Index Block

the_seo_bar_page() защищенный Метод

Output the SEO bar for Terms and Taxonomies.
С версии: 2.6.0
protected the_seo_bar_page ( array $args ) : string
$args array { 'is_term' => $is_term, 'term' => $term, 'post_id' => $post_id, 'post_i18n' => $post_i18n, 'post_low' => $post_low, 'type' => $type, }
Результат string $content The SEO bar.

the_seo_bar_post_data() защищенный Метод

Fetch the post data for The SEO Bar.
С версии: 2.6.0
protected the_seo_bar_post_data ( array $args ) : array
$args array The post args.
Результат array $data { 'title' => $title, 'title_is_from_custom_field' => $title_is_from_custom_field, 'description' => $description, 'description_is_from_custom_field' => $description_is_from_custom_field, 'nofollow' => $nofollow, 'noarchive' => $noarchive }

the_seo_bar_redirect_notice() защищенный Метод

Render the SEO bar redirect block and notice.
С версии: 2.6.0
protected the_seo_bar_redirect_notice ( array $args ) : string
$args array
Результат string The SEO Bar Redirect Block

the_seo_bar_term() защищенный Метод

Output the SEO bar for Terms and Taxonomies.
С версии: 2.6.0
protected the_seo_bar_term ( array $args ) : string
$args array { 'is_term' => bool $is_term, 'term' => object $term, 'post_i18n' => string $post_i18n, 'post_low' => string $post_low, 'type' => string $type, }
Результат string $content The SEO bar.

the_seo_bar_term_data() защищенный Метод

Fetch the term data for The SEO Bar.
С версии: 2.6.0
protected the_seo_bar_term_data ( array $args ) : array
$args array The term args.
Результат array $data { 'title' => $title, 'title_is_from_custom_field' => $title_is_from_custom_field, 'description' => $description, 'description_is_from_custom_field' => $description_is_from_custom_field, 'nofollow' => $nofollow, 'noarchive' => $noarchive }

the_seo_bar_title_notice() защищенный Метод

Render the SEO bar title block and notice.
С версии: 2.6.0
protected the_seo_bar_title_notice ( array $args ) : string
$args array
Результат string The SEO Bar Title Block

wrap_the_seo_bar_block() защищенный Метод

Outputs a part of the SEO Bar based on parameters.
С версии: 2.6.0
protected wrap_the_seo_bar_block ( array $args ) : string
$args array : { string $indicator string $notice string $width string $class }
Результат string The SEO Bar block part.