Open searsandrew opened 8 years ago
Took a quick look at this, right now, I'm thinking we may only be able to do this if we build a nested shortcode for the bootstrap columns. Make's it a little more confusing but it might be better in the long run.
Maybe we wrap everything in a [bootstrap-columns]
shortcode, and nest a [bootstrap-column]
inside of it?
[bootstrap-columns] [bootstrap-column col="6" size="xs" row="first"]Column Content Here[/bootstrap-column] [bootstrap-column col="6" size="xs" row="first"]Column Content Here[/bootstrap-column] [/bootstrap-columns]
There's a pretty good plugin out there that includes a lot of Bootstrap's functionality as shortcodes. I'm going to "borrow" a few of these and try to overhaul our columns. Bootstrap 3 Shortcodes
This looks to be part of your answer:
function bs_fix_shortcodes($content){
$array = array (
'<p>[' => '[',
']</p>' => ']',
']<br />' => ']',
']<br>' => ']'
);
$content = strtr($content, $array);
return $content;
}
add_filter('the_content', 'bs_fix_shortcodes');
I believe I have addressed this issue in the dev branch. I changed up the shortcode so that the columns are nested inside of a row:
[bs-row]
[bs-column md="6"]
...
[/bs-column]
[bs-column md="6"]
...
[/bs-column]
[/bs-row]
\ Just to note, I kept the old shortcode, [bs-columns]
in there for backwards compatability. Let me know if we can remove that short code or not.
Ok, one thought on this, we need an easy way for customers to know to use the [bs-row] shortcode.
Take a look at the short code in development right now. If you click on the "Bootstrap Columns" short code, a window show's listing exactly how to use the short code including all of the parameters and the option to "add the basic example" into the editor. Maybe we need to explain it better in that modal window?
Shortcode for creating the Bootstrap columns does not work as expected since WordPress inserts blank paragraph tags.