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
- How can I remove the wp_autop filter from a shortcode block in a block theme page template (twenty twenty-three)?
- shortcode causes broken paragraph tags
- How to use/enable Pagination?
- Placing tags on wordpress visual editor using shortcodes
- Shortcode called twice
- Favorite websites with shortened hyperlinks
- Best way to find all shortcodes that come with WordPress
- Using Variables in Shortcodes
- Default Attributes in Shortcode Not Working
- Replacement for gallery_shortcode function not taking all attributes
- Add JS in footer via shortcode?
- Shortcode syntax errors
- Passing variable in nested shortcodes
- Shortcode Always Displays Default Attribute Value
- how can i pass this attribute in this shortcode?
- How to add a same div on every page
- WordPress Shortcode / Only works in classic editor, gutenberg error / invalid json response
- Display a form partially with a shortcode
- Do shortcode in template file
- How do I fit a function inside an opening and closing do_shortcode
- Modifying the wordpress login page and then referencing it with a shortcode problem
- Pass instance number to shortcode child
- How to make shortcode which returns HTML?
- Render shortcodes with get_post_custom
- How to create a custom shortcode for custom login form?
- Pass a comma separated shortcode attribute to a function
- Enclosing Shortcode not working in a Template
- how to write short code in word press
- hard code shortcode only on specific category
- Set redirect for need login
- make user_id in a shortcode dynamic based on who’s logged in
- pass complex json as shortcode parameter
- Image Caption Shortcode Broken upon update
- Shortcode not working in CPT taxonomy
- wp_enqueue_scripts does not work on admin page
- shortcode containing other shortcodes not returning content
- How to include shortcodes and pdfs in WordPress search without plugin?
- How to embeded shortcode for another website
- To know whether insert shortcode in custom meta box
- Gutenberg Shortcode will turn html to html entity
- Need help in setting up a transient using API Key and if possible updating it in the ACF field
- the_content() not showing the content in good order (with a shortcode)
- Execute shortcode in backend
- Shortcodes not working in custom page
- Get label in user meta query
- Shortcode not being executed
- Load gravity form via ajax using do_shortcode
- How to Enable embedding WordPress default gallery in comments?
- Print shortcode according to site language
- Video Short Code and Media Fragments URI
- Remove a short code and update it’s content (AJAX)
- create a shortcode for embedding google map in a page
- How to process a single attribute in a SQL request twice times?
- Customise standard lists within my shortcode
- Timber – don’t display shortcode
- Use ACF array values in shortcode
- How to fix transparency in product sliders / featured products on home page?
- php in a shortcode
- Pull in excerpt with shortcode
- Short code format for cat tagging when posting from email
- How do I use “while” and “end while” inside of the echo do_shortcode with ACF Repeater?
- WordPress core playlist function not showing artist and album info
- Problem in creating a shortcode form custom post type slider
- Which method to use when deleting posts from the front-end
- Add an access code form to call a unique page based on page without registration
- short code is not working in in custom wordpress theme it’s only working in default theme
- add php shortcode in return function
- Display post_meta in Shortcode
- Gallery Shortcode: using size=”full” doesn’t call the actual thumbnail image size
- loop on page makes shortcode fail
- style css to header for shortcodes
- WordPress Shortcode loads at the top
- What does this shortcode do?
- php code to shortcode [duplicate]
- Shortcode leads to white screen [closed]
- How to stop an image link continuing to link adjacent text from a shortcode?
- create shortcodes for posts
- How Do I create a shortcode to dispaly a go to top button on any page or post
- Show realtime Amazon price without API using 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
- Product description is mixed in shortcodes
- Why does my JavaScript work in the browser console but does not work in my shortcode?
- add_action to only be called if uploading media from the front end