How to remove "Translation options" submenu?
-
Dear Tim,
I tried the following code in the active theme’s functions.php, but it didn’t work.
remove_submenu_page( 'admin.php', 'loco-translate-settings' );What is the correct code or function to remove the “Translation options” submenu from the “Loco Translate” menu?
Please advise. Thank you.
-
I can’t provide support for undoing what my plugin does.
If these permissions are a real problem for you, I suggest you consider running the version 2 development version.
I just want to hide the “Translation options” section from view for non-admin users only, while providing them accessibility to “Manage translations”. That’s why I wish to know how to hide it.
I’ll consider running Ver. 2 once it’s on production mode. Sorry, Tim.
I had to hack your plugin’s “/wp-content/plugins/loco-translate/lib/loco-admin.php” file, and amended the _loco_hook__admin_menu function with the following.
// Settings page if( current_user_can( 'manage_options' ) ) { $slug = Loco::NS.'-settings'; $title = $page_title.' - '.$opts_title; $page = array( 'LocoAdmin', 'render_page_options' ); add_submenu_page( Loco::NS, $title, $opts_title, $cap, $slug, $page ); // also add under Settings menu (legacy) add_options_page( $title, $opts_title, $cap, $slug.'-legacy', $page ); } else { add_action( 'admin_head', '_loco_remove_options_tab' ); } // Hook in page stuff as soon as screen is avaiable add_action('current_screen', '_loco_hook__current_screen' );Also, I added a new function that inserts a CSS code to hide the submenu’s tab.
/** * remove admin options tab (added on: 09 July 2016) */ function _loco_remove_options_tab() { echo '<style type="text/css">.loco-admin .dashicons-admin-settings { display: none; }</style>'. PHP_EOL; }I cannot figure out how to make it work in the child-theme without such necessary hack.
The topic ‘How to remove "Translation options" submenu?’ is closed to new replies.