Try the following code:
function caption_shortcode( $atts, $content = null ) {
$content = do_shortcode($content);
return '<span itemprop="articleSection">'. str_replace( array( '<', '>' ), array( '<', '>' ), $content ) .'</span>';
}
add_shortcode( 'source', 'caption_shortcode' );
remove_filter( 'the_content', 'wpautop' );
remove_filter( 'the_excerpt', 'wpautop' );
Related Posts:
- Using wp_editor in shortcode
- How to add multiple buttons to TinyMCE?
- TinyMCE popup windows using WP functions
- How to prevent tinymce macro from inserting nbsp;?
- Tinymce shortcodes within shortcode contents
- TinyMCE get selected text and underlying HTML
- Is it possible to add a repeater field to TinyMCE’s option window?
- How do I preview the result of a shortcode in the TinyMCE editor?
- Tinymce list of shortcodes button
- How to type shortcode-like text in WordPress TinyMCE visual editor?
- Preserve shortcode content formatting
- Custom Shortcode: define cursor position/insertion point?
- Documentation for adding a tinyMCE view for visual live preview of custom shortcode?
- How to prevent shortcode preview from breaking in tinymce editor?
- wp_editor in thickbox
- How to protect parts of my code from TinyMCE modification when switching from text to visual mode?
- Placing tags on wordpress visual editor using shortcodes
- Pass data back to TinyMCE from Thickbox
- Shortcode from admin textarea to page
- tinymce custom button
- Why can’t I type [ ] opening and closing brackets on the Visual tab?
- How to print [embed] code in wordpress [duplicate]
- What makes a placeholder resizable in Tinymce?
- Identifying first and last instance of shortcode in post
- Add self-closing shortcode button to TinyMCE in WP 4.6
- current_shortcode() – detect currently used shortcode
- Get shortcode name from within it’s callback function? [duplicate]
- Tinymce – How to hook before or after live shortcodes rendering?
- How to customize a shortcode using the customizer
- Stray closing paragraph tag when using shortcodes
- How to handle valueless attributes in shortcodes?
- The result of a shortcode appear BEFORE page content
- Getting the count of a shortcode that is nested
- How to render complicated shortcodes
- Get shortcode attributes outside shortcode function
- Get Shortcode Attributes
- Shortcode doesn’t work with classes
- Video size and border radius using a shortcode
- Adding shortcode to the main menu
- Inserting PHP inside do_shortcode
- wp_editor returns the shortcode and not render the output
- Prevent wordpress from rendering shortcode in post
- Can a shortcode return its own name?
- Extra paragraph tags in an enclosing shortcode
- WordPress Vue Js Shortcodes
- Shortcode multiple values
- Gravity forms – get shortcode attribute from post content
- How to get the $atts of a shortcode
- Getting the count of a shortcode that is nested
- do_shortcode via ajax
- How to list users by custom field?
- Parse Error: unexpected ‘}’ while creating Shortcode with Loop [closed]
- Code is providing a row of data but not formatting it as table
- Gutenberg Shortcode Fail
- How to add “get_theme_mod” inside a shortcode?
- passing markup thought a shortcode attribute
- Echoing Shortcode content inside the loop
- How to have shortcode autofilling the content if the attribution is specified?
- Shortcode argument multiple values
- How can I collect and output all attributes of all executed ShortCodes?
- Do I need to escape number in this shortcode function?
- Need 2 separate elements of add_shortcode for presentation
- Why ‘do_shortcode’ doesn’t work in a REST request?
- Basic custom Shortcode not working
- Theme Icons not visible on http://domain.com, works on http://ipaddress
- Add variable in between do_shortcode
- How to put custom admin setting field into a shortcode
- shortcode – I need to throw a message or load a different page
- How to add site tags in alphabetical order to shortcode?
- WordPress post shortcode pagination not working
- Using shortcodes in the Site Title
- Shortcode do not return a value
- Problem parsing long parameter in shortcode
- How to display content if user meta data isn’t empty with shortcode
- How to display total user count by specific role in WordPress as statistics?
- User name in referral URLs
- Is there any way to set the Featured image in wordpress post editor, using a Getty images embed code
- Add Style to text in a PHP block
- How I can add placeholder in shortcode
- I’m using rtMedia and Youzer. Can Shortcodes be used to display a video gallery?
- Help with a function to create a shortcode
- Content included from pagination
- Term Description Echo or Return – display problems
- Shortcode with multiple paramaters
- Replace custom gallery shortcode with default gallery shortcode
- Custom shortcode is not working inside tabs
- Does a String Replacing script affect shortcode output?
- Creating custom shortcode
- What is short code for following?
- Created a shortcode, using it twice (but differently) on a page but its just outputting the same one twice
- Access Shortcode in ajax code?
- Automate post creation in wordpress
- Shortcode not working in custom post types
- Shortcode or placeholder for theme options page?
- IFrame Shortcode plugin – issue
- How to call shortcode on button click
- How can you alter the name of attributes in a shortcode?
- Working with Shortcode, AJAX, Elementor
- How to exclude some cats from wp_list_categories using shortcut
- How can I create a shortcode that shows a list of categories on the single product page?