OK, it seems someone has trod this path and there is in fact….
shortcode_unautop()
Job Done. It looks elegant in the editor and works in the output.
The shortcode now looks like this;
function column_shortcode($atts = [], $content = null)
{
$content="<div class="two-column">".$content.'</div>';
$content = shortcode_unautop($content);
return $content;
}
add_shortcode('two-column', 'column_shortcode');
Related Posts:
- Remove wpautop from shortcode content / remove whitespace in buffering
- wpautop() when shortcode attributes are on new lines break args array
- Why does WP not like my container?
- Is shortcode_unautop() broken?
- Raw output (preventing wpautop)
- Remove empty p-Tags in Shortcode content before non p-Tags
- Remove wpautop from specific shortcodes only
- basic shortcode – Why 1st paragraph not wrapped in p tag, but 2nd is
- WordPress wpautop/shortcode generating invalid markup
- Wrap Shortcodes and wpautop
- Disable wpautop on Shortcode attributes
- Remove some tags from shortcodes output? Trying to fix autop
- Wpautop stops working after get_the_excerpt
- Can I prevent wordpress adding and tags to autoembeds
- Shortcode empty attribute
- Using wp_editor in shortcode
- Why are you using add_action for shortcode?
- How to get URL param to shortcode?
- How to display the names of users from a specific group with a shortcode?
- shortcode for logo image
- Stop strip_shortcodes() stripping content inside shortcodes
- Using audio shortcode for .mp3 URLs with a query string
- Get multiple shortcode attribute values
- How do i link gallery thumbnails to different url’s using the wp native gallery?
- How to display some selected user meta data on a specific page with a shortcode?
- Gallery shortcode menu order fix no longer working on WordPress 4.0
- How to save a shortcode in a Gutenberg custom block?
- has_shortcode for content added after the content
- Shortcode displays only default attribute values
- Can a shortcode function this way
- Dynamically create shortcodes using add_shortcode and a callback
- Creating a Slider Shortcode Based on Nivo Slider
- Passing attributes to shortcode dynamically
- Stop parsing shortcodes
- What is wrong with this code I have to make a blockquote shortcode
- Why isn’t this youtube shortcode working?
- Gist shortcode is not working
- How to set Contact Form 7 fields default value using shortcode attribute? [closed]
- Display post metadata: “title, category, author, date” with shortcode
- shortcode javascript not working on custom template file inside theme folder
- Check if post has gallery images/media
- Stop auto formatting in shortcodes
- Get URL Param Plugin and Inserting Result in Widget Code
- How to parse shortcodes within returned content
- Hook WP_Embed run_shortcode
- How to add class or id to shortcode HTML elements?
- Change WordPress Shortcode added in to post
- Changing the title tag from a shortcode
- AJAX and Shortcode with Parameters
- Detecting embeded video format
- While loop shortcode problem
- Remove ‘p’ tags around shortcodes and ‘img’
- How to prevent shortcode preview from breaking in tinymce editor?
- Execute Closing Shortcode After the_content
- Forcing max-width for image captions
- WordPress Short code with additional parameter
- Responsive Embeds using default embed shortcode
- Is it possible to modify the header with a content shortcode?
- Custom shortcode breaks my page
- Custom shortcode is causing a WSOD
- this simple shortcode doesn’t generate Collapse as supposed
- Shortcode outputting at top of content
- Get attributes of nested shortcodes
- How to create a shortcode to let the user add the ID of a YouTube video?
- How do I define and register a shortcode function in a namespaced functions.php file?
- How to add shortcode to html widget
- Implementing a URL Shortener
- WordPress User ID as Shortcode
- Add div on EMED Tag
- Clean way of using ob_start() and ob_end_clean() in wordpress
- Theme Convert PHP code to shortcode
- find shortcode inside content of post
- WordPress Short code for List style
- Processing a login/register form before shortcodes are rendered?
- Adding a cover image to video shortcode
- Insert First Image into post (full-width)
- Show content if user left comment / non-logged visitors?
- How to insert current user ID/entry ID into a shortcode?
- Need help with creating a simple shortcode
- How to display html element and php string in the same line?
- Using a WP shortcode in Homepage
- i want to show a modal when user lands on home page very first time
- create shortcode that changes url endpoint
- Logout user if click on a custom page link
- Shortcode Attribute not defined
- Attributes are not passed on nested shortcode
- Removing text + shortcode from all posts
- Is Post-Author-Id shortocde
- Load next post by ID on a single page
- Add catagory attribute to custom shortcode
- Access the resized images generated by `add_image_size()`
- Class variables in shortcodes
- Defining the output of a WordPress Att
- Remove width and height attributes from [gallery] output
- Custom WP theme not showing shortcodes
- Shortcode for sectors
- How to not show shortcode contents if cart is empty?
- Help with Shortcode Functionality
- Shortcode with foreach
- How do write this type shortcode? [closed]