I'm creating a custom plugin which needs to display HTML with dynamically updated values.
To illustrate, here's what I want to achieve:
<h1><?php print $title; ?></h1>
<h3><?php print $subtitle; ?></h3>
<div class="description"><?php print $content; ?></div>
How can I define a template, pass some variables and get output in return from my custom plugin? I do not want to embed everything as a variable name as it's messy; going back between PHP and HTML in a middle of a function doesn't seem any cleaner either.
What is WP way of doing this?
Thanks!