Just want to know how to disable right click on dashboard(admin area) side of the wordpress.already used following code for frontend(user area).
body {
-webkit-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
}
Just want to know how to disable right click on dashboard(admin area) side of the wordpress.already used following code for frontend(user area).
body {
-webkit-user-select: none;
-moz-user-select: -moz-none;
-ms-user-select: none;
user-select: none;
}
Use the selector .wp-admin
to make sure you are selecting only the wordpress admin area.
html body.wp-admin {
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
The code above will prevent the user from selecting/highlighting the page content.
If you really want to disable right click, just use a simple JS code like:
<script>
document.oncontextmenu = new Function("alert('Right click is blocked.'); return false");
</script>
References:
https://css-tricks/almanac/properties/u/user-select/