Forgive this if it's a duplicate, as I don't know what I don't know when asking this question. I am not sure I am even using the correct terminology (tokenize).
What I am trying to do is get an option that is set up in the back end of my theme:
array(
'title' => esc_html__('Email Address', 'z_theme'),
'subtitle' => esc_html__('Type email address.', 'z_theme'),
'id' => 'email_address',
'type' => 'text',
'required' => array('top_header_opt', '!=', 'false'),
'default' => '[email protected]',
),
I can easily get this via my PHP inside my theme ...
$opt = get_option('z_theme_opt');
$email_address = $opt['email_address'];
And plop it in the header / footer etc etc .. But I want the end user to be able to grab it any time with some sort of tokenized effort directly through the editor IE
<H3>[[email_address]]</H3>
While building the site out .. So that any time email_address
is changed in the theme options, it is pulled through to the rest of the site, and does not need to remain hard coded in the HTML.
With WordPress's current functionality, is this a thing? If not how would I go about building that into my theme?
echo "$email_address";
anywhere. I am building a theme .. Where I want the end user to be able to use a token in the raw HTML in the builder .. IE<H3>[[email_address]]</H3>
-- I honestly don't know how to make my question more clear. I want the$email_address
available to the front end editor.[email_address]
would be a shortcode that just dropped the text from theemail_address
setting, in any page builder's text editor? Is that what you're asking?