Hi, I’need to remove icon Menu for access to Cornestone to specific user. First rember I used these code with custom function. These old code works fine to the new relase? There’s another mode to remove “view” and “access” to pro and cornestone menu for specific user?
$user_ID = get_current_user_id();
if ($user_ID != 0) {
//remove menu
function r_m(){
remove_menu_page('x-addons-home');
}
add_action( 'admin_menu', 'r_m', 999);
//remove theme pro
add_filter( 'wp_prepare_themes_for_js', 'ht');
function ht($arr){
unset($arr["pro"]);
return $arr;
}
//remove toolbar pro
function r_tbm() {
global $wp_admin_bar;
$wp_admin_bar->remove_menu('tco-main');
}
add_action('wp_before_admin_bar_render', 'r_tbm', 999);
//remove editor list page
function r_ep() {
echo '<style>
.cs-editor-container,
.edit_cornerstone,
.edit-post-header__toolbar .components-button.is-primary.is-button {display: none;}
tr[data-slug="custom-functions-by-xonet"] {display:none;}
tr[data-slug="custom-404"] {display:none;}
tr[data-slug="insert-headers-and-footers"] {display:none;}
tr[data-slug="snippet"] {display:none;}
tr[data-slug="under-construction"] {display:none;}
tr[data-slug="white-label"] {display:none;}
</style>';
}
add_action('wp_head', 'r_ep');
add_action('admin_head', 'r_ep');
}
$user_ID = get_current_user_id();
if ($user_ID != 1) { function r_m(){ remove_menu_page('x-addons-home');} add_action( 'admin_menu', 'r_m', 999);
add_filter( 'wp_prepare_themes_for_js', 'ht'); function ht($arr){ unset($arr["pro"]); return $arr;}
function r_tbm() { global $wp_admin_bar; $wp_admin_bar->remove_menu('tco-main');}
add_action('wp_before_admin_bar_render', 'r_tbm', 999); function r_ep() { echo '<style>
.cs-editor-container, .edit_cornerstone, .edit-post-header__toolbar
.components-button.is-primary.is-button { display: none;}
tr[data-slug="custom-functions-by-xonet"] {display:none;}
tr[data-slug="custom-404"] {display:none;}
tr[data-slug="insert-headers-and-footers"] {display:none;}
tr[data-slug="snippet"] {display:none;}
tr[data-slug="under-construction"] {display:none;}
tr[data-slug="white-label"] {display:none;}</style>';}
add_action('wp_head', 'r_ep');
add_action('admin_head', 'r_ep');}