I'm trying to figure out how to display the output of a shortcode in a text field using wordpress settings api. My goal is to create a few shortcodes so that I can use one or the other along with some other text. In the example I'm trying to display the product title then some text in the text field such as sorry, [oosd-title] has sold out to display sorry, red short has sold out.
The shortcode was easy enough to do
function oosdfw_title_display() {
return get_the_title();
}
add_shortcode( 'oosd-title', 'oosdfw_title_display' );
And this generates the text field in the admin area. It's all working except the shortcode displays [oosd-title] instead of the product title
function oosdw_text_field_6_render( ) {
$options = get_option( 'oosdw_settings' );
?>
<input type="text" name="oosdw_settings[oosdw_text_field_6]" value="<?
php echo $options["oosdw_text_field_6"]; ?>">
<?php
}
I'm not quite sure what I have to do to get the shortcode to generate in the on the frontend. I did try esc_html but wasn't entirely sure how to use it or where to place it