Allow HTML in function file – Woocommerce – Checkout Add-ons
-
Hi everyone.
I am using woocommerce with the Checkout Add-ons.
I am using this code I got from this page:
// Add attributes to our checkout fields function wc_add_checkout_add_ons_attributes( $checkout_fields ) { $add_on_id = 2; // change 3 to your add-on id if ( isset( $checkout_fields['add_ons'][ 'wc_checkout_add_ons_' . $add_on_id ] ) ) { $checkout_fields['add_ons'][ 'wc_checkout_add_ons_' . $add_on_id ]['description'] = "<a href='https://www.w3schools.com/html/'> Visit our HTML tutorial</a>"; //Adds a maximum character length + description to this add on } return $checkout_fields; } add_filter( 'woocommerce_checkout_fields', 'wc_add_checkout_add_ons_attributes', 20 );
The code works.
But how can I make the html link work properly ? So far it is displayed as a normal text.Thanks
- The topic ‘Allow HTML in function file – Woocommerce – Checkout Add-ons’ is closed to new replies.