WPSEO_Rewrite::redirect()
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() WPSEO Rewrite::redirect Yoast 24.9
protected function redirect( $category_redirect ) { $catlink = trailingslashit( get_option( 'home' ) ) . user_trailingslashit( $category_redirect, 'category' ); wp_safe_redirect( $catlink, 301, 'Yoast SEO' ); exit; }