WPSEO_Rewrite::redirect()protectedYoast 1.0

Redirect the "old" category URL to the new one.

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

Хуков нет.

Возвращает

null. Ничего (null).

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

// protected - в коде основоного (родительского) или дочернего класса
$result = $this->redirect( $category_redirect );
$category_redirect(строка) (обязательный)
The category page to redirect to.

Код WPSEO_Rewrite::redirect() Yoast 22.4

protected function redirect( $category_redirect ) {
	$catlink = trailingslashit( get_option( 'home' ) ) . user_trailingslashit( $category_redirect, 'category' );

	wp_safe_redirect( $catlink, 301, 'Yoast SEO' );
	exit;
}