PHP Класс The_SEO_Framework\Core

Initializes the plugin & Holds plugin core functions.
С версии: 2.7.1
Показать файл Открыть проект

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

Метод Описание
__call ( string $name, array $arguments ) : void Handles unapproachable invoked methods.
__get ( $name ) : mixed Handles unapproachable invoked properties.
allow_external_redirect ( ) : boolean Whether to allow external redirect through the 301 redirect option.
code_wrap ( string $content ) : string Mark up content with code tags.
code_wrap_noesc ( string $content ) : string Mark up content with code tags.
current_blog_is_spam_or_deleted ( ) : boolean Whether the current blog is spam or deleted.
description ( string $content, boolean $block = true ) : string Mark up content in description wrap.
description_noesc ( string $content, boolean $block = true ) : string Mark up content in description wrap.
do_dismissible_notice ( $message = '', $type = 'updated', boolean $a11y = true, boolean $escape = true ) Echos generated dismissible notice.
generate_dismissible_notice ( string $message = '', string $type = 'updated', boolean $a11y = true, boolean $escape = true ) : string Generates dismissible notice.
get_custom_field ( string $field, integer $post_id = null ) : string | boolean Return custom field post meta data.
get_the_front_page_ID ( ) : integer Returns the front page ID, if home is a page.
get_timezone_string ( boolean $guess = false ) : string | empty Returns the PHP timezone compatible string.
get_view ( string $view, array $args = [], string $instance = 'main' ) Fetches files based on input to reduce memory overhead.
get_word_count ( string $string, integer $amount = 3, integer $amount_bother = 5, integer $bother_length = 3 ) : array Counts words encounters from input string.
gmt2date ( string $format = 'Y-m-d', string $time = '' ) : string Converts time from GMT input to given format.
is_blog_public ( ) : boolean Checks if blog is public through WordPress core settings.
is_checked ( string $value ) : boolean Checks if the string input is exactly '1'.
is_option_checked ( string $option ) : boolean Checks if the option is used and checked.
maybe_lowercase_noun ( $noun ) : string Whether to lowercase the noun or keep it UCfirst.
object_cache_get ( string $key, string $group = 'the_seo_framework', boolean $force = false, boolean &$found = null ) : mixed Object cache get wrapper.
object_cache_set ( string $key, mixed $data, integer $expire, string $group = 'the_seo_framework' ) : boolean Object cache set wrapper.
plugin_action_links ( array $links = [] ) Adds link from plugins page to SEO Settings page.
post_type_support ( ) Adds post type support for The SEO Framework.
proportionate_dimensions ( integer $i, integer $r1, integer $r2 ) : integer Proportionate dimensions based on Width and Height.
reset_timezone ( ) : boolean Resets the timezone to default or UTC.
seo_settings_page_url ( ) : string Returns the SEO Settings page URL.
set_timezone ( string $tzstring = '', boolean $reset = false ) : boolean Sets and resets the timezone.
settings_capability ( ) : string Returns the minimum role required to adjust settings.

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

Метод Описание
__clone ( ) Cloning of this object is forbidden.
__construct ( ) Constructor. Loads actions and filters.
__wakeup ( ) Unserializing instances of this object is forbidden.
clean_reponse_header ( ) : boolean Destroys output buffer, if any. To be used with AJAX and XML to clear any PHP errors or dumps.
get_tzstring_from_offset ( integer $offset ) : string Fetches the Timezone String from given offset.
get_view_instance ( string $base, string $instance = 'main' ) : string Fetches view instance for switch.
google_language ( ) : string Google docs language determinator.

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

__call() закрытый публичный Метод

Handles unapproachable invoked methods.
final public __call ( string $name, array $arguments ) : void
$name string
$arguments array
Результат void

__clone() закрытый защищенный Метод

Cloning of this object is forbidden.
final protected __clone ( )

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

Latest Class. Doesn't have parent.
protected __construct ( )

__get() закрытый публичный Метод

Makes sure deprecated properties are still accessible.
С версии: 2.7.0
final public __get ( $name ) : mixed
Результат mixed $var The object variable.

__wakeup() закрытый защищенный Метод

Unserializing instances of this object is forbidden.
final protected __wakeup ( )

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

Whether to allow external redirect through the 301 redirect option.
С версии: 2.6.0
public allow_external_redirect ( ) : boolean
Результат boolean Whether external redirect is allowed.

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

Destroys output buffer, if any. To be used with AJAX and XML to clear any PHP errors or dumps.
С версии: 2.7.1
protected clean_reponse_header ( ) : boolean
Результат boolean True on clear. False otherwise.

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

Escapes all HTML, so < gets changed to < and displays correctly.
С версии: 2.0.0
public code_wrap ( string $content ) : string
$content string Content to be wrapped in code tags.
Результат string Content wrapped in code tags.

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

Escapes no HTML.
С версии: 2.2.2
public code_wrap_noesc ( string $content ) : string
$content string Content to be wrapped in code tags.
Результат string Content wrapped in code tags.

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

Multisite Only.
С версии: 2.6.0
public current_blog_is_spam_or_deleted ( ) : boolean
Результат boolean Current blog is spam.

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

Escapes all HTML, so < gets changed to < and displays correctly.
С версии: 2.7.0
public description ( string $content, boolean $block = true ) : string
$content string Content to be wrapped in the description wrap.
$block boolean Whether to wrap the content in

tags.

Результат string Content wrapped int he description wrap.

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

Mark up content in description wrap.
С версии: 2.7.0
public description_noesc ( string $content, boolean $block = true ) : string
$content string Content to be wrapped in the description wrap. Expected to be escaped.
$block boolean Whether to wrap the content in

tags.

Результат string Content wrapped int he description wrap.

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

Echos generated dismissible notice.
С версии: 2.7.0
public do_dismissible_notice ( $message = '', $type = 'updated', boolean $a11y = true, boolean $escape = true )
$message The notice message. Expected to be escaped if $escape is false.
$type The notice type : 'updated', 'error', 'warning'. Expected to be escaped.
$a11y boolean Whether to add an accessibility icon.
$escape boolean Whether to escape the whole output.

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

Also loads scripts and styles if out of The SEO Framework's context.
С версии: 2.6.0
public generate_dismissible_notice ( string $message = '', string $type = 'updated', boolean $a11y = true, boolean $escape = true ) : string
$message string The notice message. Expected to be escaped if $escape is false.
$type string The notice type : 'updated', 'error', 'warning'. Expected to be escaped.
$a11y boolean Whether to add an accessibility icon.
$escape boolean Whether to escape the whole output.
Результат string The dismissible error notice.

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

Return only the first value of custom field. Return false if field is blank or not set.
С версии: 2.0.0
public get_custom_field ( string $field, integer $post_id = null ) : string | boolean
$field string Custom field key.
$post_id integer The post ID
Результат string | boolean Return value or false on failure.

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

Returns the front page ID, if home is a page.
С версии: 2.6.0
public get_the_front_page_ID ( ) : integer
Результат integer the ID.

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

UTC offsets are unreliable.
С версии: 2.6.0
public get_timezone_string ( boolean $guess = false ) : string | empty
$guess boolean : If true, the timezone will be guessed from the WordPress core gmt_offset option.
Результат string | empty PHP Timezone String.

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

Fetches the Timezone String from given offset.
С версии: 2.6.0
protected get_tzstring_from_offset ( integer $offset ) : string
$offset integer The GMT offzet.
Результат string PHP Timezone String.

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

Passes on input vars.
С версии: 2.7.0
public get_view ( string $view, array $args = [], string $instance = 'main' )
$view string The file name.
$args array The arguments to be supplied within the file name. Each array key is converted to a variable with its value attached.
$instance string The instance suffix to call back upon.

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

Fetches view instance for switch.
С версии: 2.7.0
protected get_view_instance ( string $base, string $instance = 'main' ) : string
$base string The instance basename (namespace).
$instance string The instance suffix to call back upon.
Результат string The file instance case.

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

Case insensitive. Returns first encounter of each word if found multiple times.
С версии: 2.7.0
public get_word_count ( string $string, integer $amount = 3, integer $amount_bother = 5, integer $bother_length = 3 ) : array
$string string Required. The string to count words in.
$amount integer Minimum amount of words to encounter in the string. Set to 0 to count all words longer than $bother_length.
$amount_bother integer Minimum amount of words to encounter in the string that fall under the $bother_length. Set to 0 to count all words shorter than $bother_length.
$bother_length integer The maximum string length of a word to pass for $amount_bother instead of $amount. Set to 0 to pass all words through $amount_bother
Результат array Containing arrays of words with their count.

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

Converts time from GMT input to given format.
С версии: 2.7.0
public gmt2date ( string $format = 'Y-m-d', string $time = '' ) : string
$format string The datetime format.
$time string The GMT time. Expects timezone to be omitted.
Результат string The converted time. Empty string if no $time is given.

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

Google docs language determinator.
С версии: 2.2.2
protected google_language ( ) : string
Результат string language code

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

Checks if blog is public through WordPress core settings.
С версии: 2.6.0
public is_blog_public ( ) : boolean
Результат boolean True is blog is public.

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

Checks if the string input is exactly '1'.
С версии: 2.6.0
public is_checked ( string $value ) : boolean
$value string The value to check.
Результат boolean true if value is '1'

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

Checks if the option is used and checked.
С версии: 2.6.0
public is_option_checked ( string $option ) : boolean
$option string The option name.
Результат boolean Option is checked.

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

Depending if language is German.
С версии: 2.6.0
public maybe_lowercase_noun ( $noun ) : string
Результат string The maybe lowercase noun.

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

Object cache get wrapper.
С версии: 2.4.3
public object_cache_get ( string $key, string $group = 'the_seo_framework', boolean $force = false, boolean &$found = null ) : mixed
$key string The Object cache key.
$group string The Object cache group.
$force boolean Whether to force an update of the local cache.
$found boolean Whether the key was found in the cache. Disambiguates a return of false, a storable value.
Результат mixed wp_cache_get if object caching is allowed. False otherwise.

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

Object cache set wrapper.
С версии: 2.4.3
public object_cache_set ( string $key, mixed $data, integer $expire, string $group = 'the_seo_framework' ) : boolean
$key string The Object cache key.
$data mixed The Object cache data.
$expire integer The Object cache expire time.
$group string The Object cache group.
Результат boolean true on set, false when disabled.

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

Adds post type support for The SEO Framework.
С версии: 2.1.6
public post_type_support ( )

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

AKA Aspect Ratio.
С версии: 2.6.0
public proportionate_dimensions ( integer $i, integer $r1, integer $r2 ) : integer
$i integer The dimension to resize.
$r1 integer The deminsion that determines the ratio.
$r2 integer The dimension to proportionate to.
Результат integer The proportional dimension, rounded.

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

Resets the timezone to default or UTC.
С версии: 2.6.0
public reset_timezone ( ) : boolean
Результат boolean True on success. False on failure.

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

Returns the SEO Settings page URL.
С версии: 2.6.0
public seo_settings_page_url ( ) : string
Результат string The escaped SEO Settings page URL.

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

Sets and resets the timezone.
С версии: 2.6.0
public set_timezone ( string $tzstring = '', boolean $reset = false ) : boolean
$tzstring string Optional. The PHP Timezone string. Best to leave empty to always get a correct one.
$reset boolean Whether to reset to default. Ignoring first parameter.
Результат boolean True on success. False on failure.

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

Applies filter 'the_seo_framework_settings_capability' : string This filter changes the minimum role for viewing and editing the plugin's settings.
С версии: 2.6.0
public settings_capability ( ) : string
Результат string The minimum required capability for SEO Settings.