WP_Taxonomy::remove_rewrite_rules()

In this article

Removes any rewrite rules, permastructs, and rules for the taxonomy.

Source

public function remove_rewrite_rules() {
	/* @var WP $wp */
	global $wp;

	// Remove query var.
	if ( false !== $this->query_var ) {
		$wp->remove_query_var( $this->query_var );
	}

	// Remove rewrite tags and permastructs.
	if ( false !== $this->rewrite ) {
		remove_rewrite_tag( "%$this->name%" );
		remove_permastruct( $this->name );
	}
}

Changelog

VersionDescription
4.7.0Introduced.

User Contributed Notes

You must log in before being able to contribute a note or feedback.