WordPress как на ладони
Недорогой хостинг для сайтов на WordPress: wordpress.jino.ru Получай пассивный доход от сайта
класс не описан

Yoast\WP\SEO\Presenters

Abstract_Indexable_Presenter{} Yoast 1.0

Abstract presenter class for indexable presentations.

Хуков нет.

Возвращает

null. Ничего.

Использование

$Abstract_Indexable_Presenter = new Abstract_Indexable_Presenter();
// use class methods

Методы

  1. escape_key()
  2. get()
  3. get_key()
  4. replace_vars( $string )

Код Abstract_Indexable_Presenter{} Yoast 16.8

<?php
abstract class Abstract_Indexable_Presenter extends Abstract_Presenter {

	/**
	 * The WPSEO Replace Vars object.
	 *
	 * @var WPSEO_Replace_Vars
	 */
	public $replace_vars;

	/**
	 * The indexable presentation.
	 *
	 * @var Indexable_Presentation
	 */
	public $presentation;

	/**
	 * The helpers surface
	 *
	 * @var Helpers_Surface
	 */
	public $helpers;

	/**
	 * The tag key name.
	 *
	 * @var string
	 */
	protected $key = 'NO KEY PROVIDED';

	/**
	 * Gets the raw value of a presentation.
	 *
	 * @return string|array The raw value.
	 */
	abstract public function get();

	/**
	 * Transforms an indexable presenter's key to a json safe key string.
	 *
	 * @return string
	 */
	public function escape_key() {
		if ( $this->key === 'NO KEY PROVIDED' ) {
			return null;
		}
		return \str_replace( [ ':', ' ', '-' ], '_', $this->key );
	}

	/**
	 * Returns the metafield's property key.
	 *
	 * @return string The property key.
	 */
	public function get_key() {
		return $this->key;
	}

	/**
	 * Replace replacement variables in a string.
	 *
	 * @param string $string The string.
	 *
	 * @return string The string with replacement variables replaced.
	 */
	protected function replace_vars( $string ) {
		return $this->replace_vars->replace( $string, $this->presentation->source );
	}
}