WP_Rewrite::set_tag_base()publicWP 2.3.0

Sets the tag base for the tag permalink.

Will update the 'tag_base' option, if there is a difference between the current tag base and the parameter value. Calls WP_Rewrite::init() after the option is updated.

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

Хуков нет.

Возвращает

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

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

global $wp_rewrite;
$wp_rewrite->set_tag_base( $tag_base );
$tag_base(строка) (обязательный)
Tag permalink structure base.

Список изменений

С версии 2.3.0 Введена.

Код WP_Rewrite::set_tag_base() WP 6.5.2

public function set_tag_base( $tag_base ) {
	if ( get_option( 'tag_base' ) !== $tag_base ) {
		update_option( 'tag_base', $tag_base );
		$this->init();
	}
}