I've created a shortcode for PHP file plugin template, now the template has two HTML design one with icons displayed and another shows only the Name.
Is it possible to trigger a bool when do_shotecode for icons in functions.php and then in the template file I check for bool and say if do_shortcode has parameter icon set to true then echo content with icons?
Paths for files I'm working on
- functions.php: child-theme/
- plugin template: child-theme/folderName/plugin_template.php
Basic code e.g
<?php if(do_shortcode_bool_with_icons == true ) { ?>
<h2>Print Items with Icons </h2>
<ul>
<li>Coffee</li>
</ul>
<?php } ?>
<?php if(do_shortcode_bool_text_only == true ) { ?>
<h2>Print Names only without icons</h2>
<ol>
<li>Coffee</li>
</ol>
<?php } ?>