Add filter to disable Admin page
-
Hi,
As a developer I really like the simplicity of this plugin and the ability to use filters to register a custom icon set. As of version 1.0.9 a settings page was added to WP-Admin. I’d like to request a new filter to disable this page. For now I’ve done it by adding a few filters, which I know won’t prevent someone from directly accessing the page but does a good enough job of hiding it for my needs:
function admin_remove_menu_pages() { remove_submenu_page( 'options-general.php', 'jvm-rich-text-icons' ); } add_action( 'admin_menu', 'admin_remove_menu_pages' ); function disable_plugin_settings( $actions, $plugin_file, $plugin_data, $context ) { if ( array_key_exists( '0', $actions ) && in_array( $plugin_file, array( 'jvm-rich-text-icons/plugin.php' ) ) ) { unset( $actions['0'] ); } return $actions; } add_filter( 'plugin_action_links', 'disable_plugin_settings', 10, 4 );
`
(Aside, but I’d also recommend giving the settings link an array key like
settings
as with the solution above it’s possible that the numeric array key will change and the above will break)A filter to disable this would be great as it will allow advanced users the ability to disable the WP-Admin settings at the code level.
- The topic ‘Add filter to disable Admin page’ is closed to new replies.