mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-08-11 12:20:22 +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:
@@ -178,7 +178,7 @@ function add_rewrite_tag( $tag, $regex, $query = '' ) {
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @see WP_Rewrite::add_permastruct()
|
||||
* @global WP_Rewrite $wp_rewrite
|
||||
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
|
||||
*
|
||||
* @param string $name Name for permalink structure.
|
||||
* @param string $struct Permalink structure.
|
||||
@@ -197,6 +197,25 @@ function add_permastruct( $name, $struct, $args = array() ) {
|
||||
$wp_rewrite->add_permastruct( $name, $struct, $args );
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove permalink structure.
|
||||
*
|
||||
* Can only be used to remove permastructs that were added using add_permastruct().
|
||||
* Built-in permastructs cannot be removed.
|
||||
*
|
||||
* @since 4.5.0
|
||||
*
|
||||
* @see WP_Rewrite::remove_permastruct()
|
||||
* @global WP_Rewrite $wp_rewrite WordPress rewrite component.
|
||||
*
|
||||
* @param string $name Name for permalink structure.
|
||||
*/
|
||||
function remove_permastruct( $name ) {
|
||||
global $wp_rewrite;
|
||||
|
||||
$wp_rewrite->remove_permastruct( $name );
|
||||
}
|
||||
|
||||
/**
|
||||
* Add a new feed type like /atom1/.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user