Skip to content

sentisoft/shortcode-wpautop-control

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 

Repository files navigation

Shortcode wp-autop control

Allows you to turn off autop in individual shortcodes. It is inteded to be used within WordPress plugins and should not collide with other plugins that use it also.

In the past, if you created a shortcode, you had no way to stop wpautop from affecting the content within your shortcode. Now you can.

Usage:

include "shortcode-wpautop-control.php";
chiedolabs_shortcode_wpautop_control(array('yourshortcode'));

Example

To help you understand what this does, lets pretend we made a shortcode that outputs code blocks.

###Without this script Input in the Wordpress editor:

[code]
<div>
	<div></div>
</div>
[/code]

Output in the browser:

<div><br/>
	<div></div><br/>
</div><br/>

Notice how WordPress has added br tags we don't want?

###With this script The top of your php file:

include "shortcode-wpautop-control.php";
chiedolabs_shortcode_wpautop_control(array('code'));

Input in the Wordpress editor:

[code]
<div>
	<div></div>
</div>
[/code]

Output in browser:

<div>
	<div></div>
</div>

About

Allows you to turn off wpautop for specific shortcodes

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages