Yoast\WP\SEO\Presenters
Abstract_Indexable_Tag_Presenter{} Yoast 1.0
Abstract presenter class for indexable tag presentations.
Хуков нет.
Возвращает
Null. Ничего.
Использование
$Abstract_Indexable_Tag_Presenter = new Abstract_Indexable_Tag_Presenter(); // use class methods
Методы
Код Abstract_Indexable_Tag_Presenter{} Abstract Indexable Tag Presenter{} Yoast 15.6.2
abstract class Abstract_Indexable_Tag_Presenter extends Abstract_Indexable_Presenter {
/**
* The tag format including placeholders.
*
* @var string
*/
protected $tag_format = '';
/**
* The method of escaping to use.
*
* @var string
*/
protected $escaping = 'attribute';
/**
* Returns a tag in the head.
*
* @return string The tag.
*/
public function present() {
$value = $this->get();
if ( \is_string( $value ) && $value !== '' ) {
return \sprintf( $this->tag_format, $this->escape( $value ) );
}
return '';
}
/**
* Escaped the output.
*
* @param string $value The value.
*
* @return string The escaped value.
*/
protected function escape( $value ) {
if ( $this->escaping === 'html' ) {
return \esc_html( $value );
}
if ( $this->escaping === 'url' ) {
return \esc_url( $value );
}
return \esc_attr( $value );
}
}