Use a shortcode with parameters
function oosdfw_title_display($atts) {
$a = shortcode_atts( array(
'before' => 'Sorry, ',
'after' => ' has sold out.',
), $atts );
return $a['before'].get_the_title().$a['after'];
}
add_shortcode( 'oosd-title', 'oosdfw_title_display' );
Put shortcode in text field and modify before
and after
parameters to suit your requirements.
[oosd-title before="Sorry " after = " has sold out."]
There is no need to display the output of shortcode within text field
Front-end
$options = get_option( 'oosdw_settings' );
echo do_shortcode( $options["oosdw_text_field_6"]);
I hope this helps
Related Posts:
- WordPress plugin shortcode not working
- How do I create a Shortcode that returns text if domain is .com, not .co.uk
- Remove specific shortcode from get_the_content()
- How to Output HTML tags in do_shortcode?
- Nested Shortcode Detection
- Get all posts containing a shortcode
- How to display html in a shortcode
- Custom form, shortcode, and submit handler
- Automatically add this attribute to the gallery shortcode
- Videos via the video shortcode are always 640px wide?
- shortcode not working [closed]
- Do not show child pages of child pages
- How to: How do I make my own shortcodes without plugins?
- Adding span tags within wp_list_pages list items
- Create a shortcode in WordPress, again
- gutenberg widget outputting paragraph marks
- How to make shortcode output display where I choose
- Add Shortcode to a Div or Header [closed]
- change wordpress gallery shortcode to slider
- How to get total number of shortcodes in the wordpress application?
- How to change the page break numbering?
- Allow shortcode in the author bio textarea
- WordPress display image link in shortcode
- How do I combine my shortcodes?
- Bulk converting shortcodes to blocks with embeds
- How to add source code into wordpress post really?
- stop shortcode stripping in category and archive pages
- Make shortcode’s Bootstrap CSS override the theme’s CSS, how?
- How does one insert a variable value into a “myCRED plugin shortcode [closed]
- Enumeration Contact form using database table’s numbe of rows [closed]
- Change the default video shortcode
- How to add AJAX in a custom PHP function using Google sheets API
- How do I display “Hello username” if logged-in on the homepage
- Adding a Cookie Session to Shortcode Content
- Shortcode function executed twice?
- Pagination for a page created by the shortcode “Product”
- WordPress TinyMCE : Get value of popup button
- wp_editor in thickbox
- Using _e() on text inside video tags prints that text, instead of only showing when html5 element is not supported
- How to use the same shortcode with different attribute values on same page
- Youtube shortcode
- WordPress messes up with data attributes in shortcode output
- Shortcode will not pass attribute through to my function [duplicate]
- WordPress post pagination continuous [duplicate]
- custom field value as shortcode parameter
- How to edit blog page in wordpress? there is no place to put shortcode
- Shortcode don’t work in custom option field, any solution?
- Slow page Loads When Using Dynamic Coding
- Can I use shortcodes in mail body
- Query to list all galleries under a parent post?
- Adding the username into a URL to redirect to a specific page
- Shortcode Help Needed → attributes
- Video Shortcode & Video Poster Question
- How to use a nested shortcode to render the value of an attribute in parent shortcode
- Ordering get_terms with ACF not displaying all terms
- How to Get Shortcode in Excerpt to follow Document Flow
- Cant fix this Warning: Invalid argument supplied for foreach() in [closed]
- Different ID in every shortcode
- Unique ID for WordPress shortcodes when used more than once on a page?
- Which wordpress function is the caption shortcode linked to?
- Content between shortcodes
- Shortcode strips formatting and returns at content top
- do_shortcode within a shortcode
- tiny_mce_before_init preventing custom shortcode icon appearing
- Custom Fields – Boolean Display of True/False to Yes/No
- Twitter bootstrap tabs
- Build Clickable Link Using Multiple Attributes
- Using Shorcodes in Sharing Preview and Notifications Title from Post Title
- Is the WP audio shortcode still relevant?
- Third-Party API – PHP Fatal Errors Paired with http_request_failed / cURL error 28
- If statement shortcode
- Using within a shortcode
- Shortcode not working when I output data from wpdb html table row
- update_metadata() appends shortcode data for every page refresh
- How can I disable(remove) wpautop (wptexturize, convert_chars) for specific shortcodes only?
- How to load specific template page in a custom shortcode
- WordPress keeps automatically inserts
- Function in a wordpress shortcode
- shortcode is not rendered
- nested shortcodes from different plugins. too complex? [duplicate]
- Contact form code not working. Need help!
- How to make shortcode enabled in JSON Feeds?
- How to add a shortcode to an HTML image tag
- Shortcode or Template Page
- Automatically add class-attribute to gallery?
- Shortcode works from functions.php but not from included file
- Why can’t I type [ ] opening and closing brackets on the Visual tab?
- Shortcode for External HTML
- How to implement theme shortcodes in text outside of pages?
- Members only Passthrough
- load plugin with ajax [duplicate]
- Shortcode Attribute
- Can not get shortcode content in function
- Question about do_shortcode
- Enclosing shortcodes create line breaks
- Add the results of a custom query into a do_shortcode
- Identifying first and last instance of shortcode in post
- Executing a shortcode at the top of PAGE template?
- Display a block conditionally based on user input button
- Custom shortcode with < in content