I have inherited a website that has custom code in the functions.php file to create a custom Tab in Woocommerce products. This will eventually become obsolete as I update the site but for now I need to insert a font awesome Icon before the Tab Title Text
Below is the code that appears in the functions.php, how do I add a Font Awesome Icon to appear before the Title 'TECHNICAL DOCUMENTS'. The font awesome class is "fas fa-book"
add_filter( 'woocommerce_product_tabs', 'add_product_specs_tab' );
function add_product_specs_tab( $tabs ) {
$tabs['product_specs'] = [
'title' => __( 'TECHNICAL DOCUMENTS', 'woocommerce' ),
'priority' => 50,
'callback' => 'add_product_specs_tab_content'
];
return $tabs;
}
function add_product_specs_tab_content() {
global $post;
$pdf = get_field( 'pdf', $post->ID );
if ( ! $pdf ) {
echo "<h3>Sorry!! No Spec for This Product</h3>";
} else {
echo '<div id="product-download-specs-btn">';
echo '<h3>Download the Product Spec below</h3>';
echo sprintf( '<a href="%s">Download</a>', $pdf );
echo '</div>';
if ( ! is_user_logged_in() ) {
echo '<div id="product-download-specs-form" data-pdf="'.$pdf.'">';
echo apply_shortcodes('[contact-form-7 id="33372396" title="Product Spec"]');
echo '</div>';
}
}
}
'title'
in theadd_product_specs_tab()
function? eg'title' => '<span class="fas fas-book"></span> ' . __( 'TECHNICAL DOCUMENTS', 'woocommerce' )
?