Yoast\WP\SEO\Generators
Breadcrumbs_Generator::get_date_archive_crumb() protected Yoast 1.0
Returns the modified date archive crumb.
{} Это метод класса: Breadcrumbs_Generator{}
Хуков нет.
Возвращает
Массив. The crumb.
Использование
// protected - в коде основоного (родительского) или дочернего класса $result = $this->get_date_archive_crumb( $crumb );
- $crumb(массив) (обязательный)
- The crumb.
Код Breadcrumbs_Generator::get_date_archive_crumb() Breadcrumbs Generator::get date archive crumb Yoast 15.6.2
protected function get_date_archive_crumb( $crumb ) {
$home_url = $this->url_helper->home();
$prefix = $this->options->get( 'breadcrumbs-archiveprefix' );
if ( \is_day() ) {
$day = \esc_html( \get_the_date() );
$crumb['url'] = $home_url . \get_the_date( 'Y/m/d' ) . '/';
$crumb['text'] = $prefix . ' ' . $day;
}
elseif ( \is_month() ) {
$month = \esc_html( \trim( \single_month_title( ' ', false ) ) );
$crumb['url'] = $home_url . \get_the_date( 'Y/m' ) . '/';
$crumb['text'] = $prefix . ' ' . $month;
}
elseif ( \is_year() ) {
$year = \get_the_date( 'Y' );
$crumb['url'] = $home_url . $year . '/';
$crumb['text'] = $prefix . ' ' . $year;
}
return $crumb;
}