WP_Rewrite::set_tag_base() WordPress Method

The WP_Rewrite::set_tag_base() method allows you to set the base for your tags. This is the string that will be used as the base for your tags in permalinks.

WP_Rewrite::set_tag_base( string $tag_base ) #

Sets the tag base for the tag permalink.


Description

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.


Top ↑

Parameters

$tag_base

(string)(Required)Tag permalink structure base.


Top ↑

Source

File: wp-includes/class-wp-rewrite.php

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


Top ↑

Changelog

Changelog
VersionDescription
2.3.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.