Hide Bricks and Happy files entries from the user profile page

Hey @Casper,

not sure why exactly you want to hide those settings but you could add the following snippet to your child theme’s functions.php file (or a code snippet plugin of your choice) to remove the corresponding elements:

add_action( 'admin_footer', function() {
	$current_screen = get_current_screen();
	if ( $current_screen->id === 'user-edit' ) {
		?>

		<script>
		const hfTable = document.querySelector('#bricks_cap_builder_access').closest('table')
		const hfTitle = hfTable.previousElementSibling
		hfTitle.remove()
		hfTable.remove()

		const bricksTable = document.querySelector('#happyfiles_folder_access').closest('table')
		const bricksTitle = bricksTable.previousElementSibling
		bricksTitle.remove()
		bricksTable.remove()
		</script>

		<?php
	}
} );

Let me know if that helps.

Best,

André

1 Like