Yoast\WP\SEO\Presenters

Canonical_Presenter::get()publicYoast 1.0

Run the canonical content through the wpseo_canonical

Метод класса: Canonical_Presenter{}

Хуки из метода

Возвращает

Строку. The filtered canonical.

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

$Canonical_Presenter = new Canonical_Presenter();
$Canonical_Presenter->get();

Код Canonical_Presenter::get() Yoast 22.4

public function get() {
	if ( \in_array( 'noindex', $this->presentation->robots, true ) ) {
		return '';
	}

	/**
	 * Filter: 'wpseo_canonical' - Allow filtering of the canonical URL put out by Yoast SEO.
	 *
	 * @param string                 $canonical    The canonical URL.
	 * @param Indexable_Presentation $presentation The presentation of an indexable.
	 */
	return \urldecode( (string) \trim( \apply_filters( 'wpseo_canonical', $this->presentation->canonical, $this->presentation ) ) );
}