Skip to content

Instantly share code, notes, and snippets.

@marcusig
Created August 23, 2022 10:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcusig/86ef40336557538def3d1ad27b2852ee to your computer and use it in GitHub Desktop.
Save marcusig/86ef40336557538def3d1ad27b2852ee to your computer and use it in GitHub Desktop.
[Configurator] add html support to layer name
<?php
// Add the new label, with html support: {{{ instead of {{
function my_prefix_frontend_configurator_layer_name() {
?>
<span class="text layer-name">{{{data.name}}}</span>
<?php
}
add_action( 'tmpl-mkl-pc-configurator-layer-item-button', 'my_prefix_frontend_configurator_layer_name', 10 );
// Remove the existing label
add_action( 'mkl_pc_frontend_templates_before', function() {
remove_action( 'tmpl-mkl-pc-configurator-layer-item-button', 'mkl_pc_frontend_configurator_layer_name', 10 );
} );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment