permalink_structure_changed
Action HookDescription
Fires after the permalink structure is updated.Hook Information
File Location |
wp-includes/class-wp-rewrite.php
View on GitHub
|
Hook Type | Action |
Line Number | 1977 |
Hook Parameters
Type | Name | Description |
---|---|---|
string
|
$old_permalink_structure
|
The previous permalink structure. |
string
|
$permalink_structure
|
The new permalink structure. |
Usage Examples
Basic Usage
<?php
// Hook into permalink_structure_changed
add_action('permalink_structure_changed', 'my_custom_function', 10, 2);
function my_custom_function($old_permalink_structure, $permalink_structure) {
// Your custom code here
}
Source Code Context
wp-includes/class-wp-rewrite.php:1977
- How this hook is used in WordPress core
<?php
1972 * @since 2.8.0
1973 *
1974 * @param string $old_permalink_structure The previous permalink structure.
1975 * @param string $permalink_structure The new permalink structure.
1976 */
1977 do_action( 'permalink_structure_changed', $old_permalink_structure, $permalink_structure );
1978 }
1979 }
1980
1981 /**
1982 * Sets the category base for the category permalink.
PHP Documentation
<?php
/**
* Fires after the permalink structure is updated.
*
* @since 2.8.0
*
* @param string $old_permalink_structure The previous permalink structure.
* @param string $permalink_structure The new permalink structure.
*/
Quick Info
- Hook Type: Action
- Parameters: 2
- File: wp-includes/class-wp-rewrite.php
Related Hooks
Related hooks will be displayed here in future updates.