Support » Plugin: JVM Gutenberg Rich Text Icons » Add filter to disable Admin page

  • Resolved Brooke.

    (@brookedot)


    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.

    • This topic was modified 5 months, 1 week ago by Brooke..
Viewing 1 replies (of 1 total)
  • Plugin Author Joris van Montfort

    (@jorisvanmontfort)

    Hi Brooke,

    Please update to the latest version (1.1.0).

    You can now use:
    add_filter('jvm_richtext_icons_show_settings', '__return_false');
    to disable the settings screen.

    If you like the plugin please consider a small donation.

    All the work put into this plugin based on donations.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.