bricks added new feature to disable the default icons but some styles still persists and creates network call for sometimes.
anyway if anyone needs to or wants to remove default icons this is the snippet too use
if any new icon lib gets added to the library this snippet may need t obe updated keep it in mind
a bit of extreme way but they best way as aswell since this methodology just KILLS those sources and styles for good 🙂
/**
* Dequeue and deregister Bricks icon fonts (Late Execution)
*/
function my_custom_dequeue_bricks_icons_late() {
// 1. Font Awesome 6
wp_dequeue_style( 'bricks-font-awesome-6' );
wp_deregister_style( 'bricks-font-awesome-6' );
// 2. Font Awesome 6 Brands
wp_dequeue_style( 'bricks-font-awesome-6-brands' );
wp_deregister_style( 'bricks-font-awesome-6-brands' );
// 3. Ionicons
wp_dequeue_style( 'bricks-ionicons' );
wp_deregister_style( 'bricks-ionicons' );
// 4. Themify Icons
wp_dequeue_style( 'bricks-themify-icons' );
wp_deregister_style( 'bricks-themify-icons' );
}
// Run extremely late (priority 9999) to ensure it overrides Bricks
add_action( 'enqueue_block_editor_assets', 'my_custom_dequeue_bricks_icons_late', 9999 );
add_action( 'wp_enqueue_scripts', 'my_custom_dequeue_bricks_icons_late', 9999 );
add_action( 'admin_enqueue_scripts', 'my_custom_dequeue_bricks_icons_late', 9999 );