Shortcodes get wrapped with p tags

I would like to insert some shortcodes in the wordpress editor (v 3.3+)

The string looks like

[a_col]<p>some text or other stuff</p>[/a_col]

which is fine but if i use this line in JS

tinyMCE.get('content').setContent(string);

my shortcodes get surrounded by p tags which looks like

<p>[a_col]</p><p>some text or other stuff</p><p>[/a_col]</p>

I really don't like to touch native functions. Maybe there is a different solution to insert content

Solutions

If you were to add_filter on 'the_content', you could probably parse the

tags out:

http://codex.wordpress.org/Function_Reference/add_filter

This issue was fixed in Wordpress version 2.5.1 see the shortcode API for further details

When in the "editor" switch to HTML mode from tinymce mode. That way it's not converting what you have in the textfield.

Similar questions

How do I get term data associated with the current post, where the result is not wrapped in HTML?
I'd like to get term data from a custom taxonomy associated with the current post. I can do this with get_the_term_list($id $custom_taxonomy). However, this returns the data I want wrapped in HTML. I'd like to get the data but not wrapped in HTML. I presume this means using a function that returns an object, and from that point I'd work with the ob...
WPTouch - how to remove shortcodes or make shortcodes function
So as the title states - using WPTouch Mobile plugin (NOT Pro) I either want to make the shortcodes work as they should or remove them altoghether. Currently they render on the page as [shortcode] which is no good. I am good with a hack or any other solution.
Split shortcodes to array of shortcodes
For example, I have a very complex shortcodes like this: How can I split these shortcodes to: Thank you!
Multiple shortcodes only use attributes from one of the shortcodes on custom plugin
Created a shortcode, however when multiple shortcodes are used on a page the $atts passed in are only from the last shortcode that was used. What am I doing wrong? I was able to find an in depth answer to this same problem here: Localize variable for multiple Shortcodes
Two different inner shortcode under shortcodes or multiple nesting of inner shortcodes
I have asked a similar question before, which was also answered: Shortcode under a Shortcode Multiple times Possible? But I am in a situation where I need to publish two inner shortcodes with different HTML. In the answer suggested in the linked text when we intend to publish two inner shortcodes how can we do that when this is not unique in two ca...
Laravel webwizo shortcodes package Shortcodes class not found
I recently started using laravel so i'm a beginner, and right now i'm working on a small project which requires me use shortcodes(like the ones in wordpress). So i searched for a little bit and found this package: https://packagist.org/packages/webwizo/laravel-shortcodes I ran the installation and usage the way it's written but i get the error : Cl...

Also ask

We use cookies to deliver the best possible experience on our website. By continuing to use this site, accepting or closing this box, you consent to our use of cookies. To learn more, visit our privacy policy .