Change WordPress user roles and capabilities › Forums › How to or FAQ › Including Tablepress in a Role › Reply To: Including Tablepress in a Role
02/01/2021 at 05:09
#7233
Vladimir
Keymaster
Hi,
It’s possible. Code below redefines gTranslate menu with ‘manage_options’ capability:
add_action('plugins_loaded', 'redefine_gtranslate_menu');
function redefine_gtranslate_menu() {
remove_action('admin_menu', array('GTranslate', 'admin_menu'), 10 );
add_action('admin_menu', 'replace_gtranslate_menu' );
}
function replace_gtranslate_menu() {
add_options_page(__('GTranslate Options', 'gtranslate'), 'GTranslate', 'manage_options', 'gtranslate_options', array('GTranslate', 'options') );
}