Redirection and User Roles
-
Hi!
your plugin is great, I use it every day,
I began to need to delegate my work on redirects to someone else, so I wrote this piece of code:add_action( 'admin_init', 'add_theme_caps'); function add_theme_caps() { // gets the author role $role = get_role( 'administrator' ); // This only works, because it accesses the class instance. $role->add_cap( 'redirection_manage_redirects' ); }and I edited redirection.php at:
add_management_page( __( "Redirection", 'redirection' ), __( "Redirection", 'redirection' ), "administrator", basename( __FILE__ ), array( &$this, "admin_screen" ) );in:
add_management_page( __( "Redirection", 'redirection' ), __( "Redirection", 'redirection' ), "redirection_manage_redirects", basename( __FILE__ ), array( &$this, "admin_screen" ) );So I can now use User Role Editor to edit permissions, using the default behavior if it is not installed,
hoping it will be useful,
Bye!Davide
The topic ‘Redirection and User Roles’ is closed to new replies.