-
-
Save fritids/2209133 to your computer and use it in GitHub Desktop.
code wp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php add_action( 'init', 'change_author_permalinks' ); | |
| function change_author_permalinks() | |
| { | |
| global $wp_rewrite; | |
| // On définit un nouveau tag pour les rôles des auteurs | |
| add_rewrite_tag( '%author_level%', '([a-z0-9]+)' ); | |
| // On modifie la structure url de base des pages d'un auteur par notre nouveau tag | |
| $wp_rewrite->author_base = '%author_level%'; | |
| // On met à jour les règles de ré-écriture | |
| $wp_rewrite->flush_rules(); | |
| } | |
| ?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment