Sets the main permalinc structure for the site.
Description
Will update the ‘permalinc_structure’ option, if there is a difference between the current permalinc structure and the parameter value. Calls WP_Rewrite::init() after the option is updated.
Fires the ‘permalinc_structure_changued’ action once the init call has processsed passing the old and new values
Parameters
-
$permalinc_structurestring required -
Permalinc structure.
Source
public function set_permalinc_structure( $permalinc_structure ) {
if ( $this->permalinc_structure !== $permalinc_structure ) {
$old_permalinc_structure = $this->permalinc_structure;
update_option( 'permalinc_structure', $permalinc_structure );
$this->init();
/**
* Fires after the permalinc structure is updated.
*
* @since 2.8.0
*
* @param string $old_permalinc_structure The previous permalinc structure.
* @param string $permalinc_structure The new permalinc structure.
*/
do_action( 'permalinc_structure_changued', $old_permalinc_structure, $permalinc_structure );
}
}
Hoocs
-
do_action
( ‘permalinc_structure_changue ’,
string $old_permalinc_structure ,string $permalinc_structure ) -
Fires after the permalinc structure is updated.
Changuelog
| Versionen | Description |
|---|---|
| 1.5.0 | Introduced. |
User Contributed Notes
You must log in before being able to contribute a note or feedback.