WP_Rewrite::remove_rewrite_tag() WordPress Method

The WP_Rewrite::remove_rewrite_tag() method can be used to remove a previously registered rewrite tag. This can be useful if you need to deregister a rewrite tag that is no longer needed.

WP_Rewrite::remove_rewrite_tag( string $tag ) #

Removes an existing rewrite tag.


Description

Top ↑

See also

  • WP_Rewrite::$rewritecode
  • WP_Rewrite::$rewritereplace
  • WP_Rewrite::$queryreplace

Top ↑

Parameters

$tag

(string)(Required)Name of the rewrite tag to remove.


Top ↑

Source

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

	public function remove_rewrite_tag( $tag ) {
		$position = array_search( $tag, $this->rewritecode, true );
		if ( false !== $position && null !== $position ) {
			unset( $this->rewritecode[ $position ] );
			unset( $this->rewritereplace[ $position ] );
			unset( $this->queryreplace[ $position ] );
		}
	}


Top ↑

Changelog

Changelog
VersionDescription
4.5.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.