thegnobo
Member
Posted 4 months ago #
Hi,
I'm trying to rewrite author permalinks to something else like "member"
this does the trick:
$wp_rewrite->author_base = 'atletes';
$wp_rewrite->flush_rules();
I'm calling this code upon plugin activation: register_activation_hook
But when another plugin,doesn't matter which one activates, this gets broken, and I have to deactivate and activate plugin again to change permalink again
is this normal?
billibones
Member
Posted 3 months ago #
Does this happen when you explicitly call wp_rewrite globally?
//Ensure the $wp_rewrite global is loaded
global $wp_rewrite;
// rewrite
$wp_rewrite->author_base = 'atletes';
//regenerate the cache as a method of the $wp_rewrite object
$wp_rewrite->flush_rules();
WP Codex: <a href="http://codex.wordpress.org/Rewrite_API/flush_rules"></a>
thegnobo
Member
Posted 3 months ago #