mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 20:30:23 +00:00
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:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user