Yoast\WP\SEO\Presenters
Canonical_Presenter::get
Run the canonical content through the wpseo_canonical
Метод класса: Canonical_Presenter{}
Хуки из метода
Возвращает
Строку
. The filtered canonical.
Использование
$Canonical_Presenter = new Canonical_Presenter(); $Canonical_Presenter->get();
Код Canonical_Presenter::get() Canonical Presenter::get Yoast 25.3
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( \trim( (string) \apply_filters( 'wpseo_canonical', $this->presentation->canonical, $this->presentation ) ) ); }