WP_Rewrite::set_category_base()
Sets the category base for the category permalink.
Will update the 'category_base' option, if there is a difference between the current category base and the parameter value. Calls WP_Rewrite::init() after the option is updated.
Метод класса: WP_Rewrite{}
Хуков нет.
Возвращает
null
. Ничего (null).
Использование
global $wp_rewrite; $wp_rewrite->set_category_base( $category_base );
- $category_base(строка) (обязательный)
- Category permalink structure base.
Список изменений
С версии 1.5.0 | Введена. |
Код WP_Rewrite::set_category_base() WP Rewrite::set category base WP 6.6.1
public function set_category_base( $category_base ) { if ( get_option( 'category_base' ) !== $category_base ) { update_option( 'category_base', $category_base ); $this->init(); } }