Hello!
I would like to remove/hide the delete button on layouts for non admin users, in order to prevent any inadvertent action.
Any tip?
Thank you very much.
Hi @bonjour
I believe you can remove it by adding JS script using the acf/input/admin_footer hook like this:
add_action('acf/input/admin_footer', 'my_acf_admin_footer');
function my_acf_admin_footer() {
?>
<script type="text/javascript">
(function($) {
$(document).ready(function(){
$(".acf-fc-layout-controlls a[data-event='remove-layout']").parent().remove();
});
})(jQuery);
</script>
<style type="text/css">
</style>
<?php
}
I hope this helps 🙂