Rewrite: Add a remove_permastruct() helper function.

It can be used to remove permastructs that were added using `add_permastruct()`.

Fixes #35235.

git-svn-id: https://develop.svn.wordpress.org/trunk@36181 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Pascal Birchler
2016-01-06 07:39:29 +00:00
parent ce4ef49b10
commit e055e5b80e
3 changed files with 72 additions and 1 deletions
+12
View File
@@ -1744,6 +1744,18 @@ class WP_Rewrite {
$this->extra_permastructs[ $name ] = $args;
}
/**
* Removes a permalink structure.
*
* @since 4.5.0
* @access public
*
* @param string $name Name for permalink structure.
*/
public function remove_permastruct( $name ) {
unset( $this->extra_permastructs[ $name ] );
}
/**
* Removes rewrite rules and then recreate rewrite rules.
*