Skip to content

Instantly share code, notes, and snippets.

@fritids
Created March 26, 2012 19:45
Show Gist options
  • Select an option

  • Save fritids/2209133 to your computer and use it in GitHub Desktop.

Select an option

Save fritids/2209133 to your computer and use it in GitHub Desktop.
code wp
<?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