/ Published in: PHP
Hide Cusmin plugin appearance from all other users, even administrators.
Add this code to active themes's functions.php
Add this code to active themes's functions.php
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
// HIDE CUSMIN //Cusmin admin user ID const CUSMIN_ADMIN_USER_ID = 1; function hide_cusmin_from_plugins_list() { if(get_current_user_id() == CUSMIN_ADMIN_USER_ID){ return; } global $wp_list_table; $myplugins = $wp_list_table->items; foreach ($myplugins as $key => $val) { } } remove_submenu_page('options-general.php','cusmin'); } function remove_cusmin_options_page() { if(get_current_user_id() == CUSMIN_ADMIN_USER_ID){ return; } //Removes cusmin link from admin menu global $pagenow; remove_submenu_page('options-general.php','cusmin'); //Redirects from Cusmin options page to admin homepage wp_redirect( admin_url() ); exit; } } add_action( 'pre_current_active_plugins', 'hide_cusmin_from_plugins_list' ); add_action( 'admin_init', 'remove_cusmin_options_page', 999); // HIDE CUSMIN
URL: https://cusmin.com