>
Download This Plugin | |
Download Elegant Themes | |
Name | Priority Shortcodes |
Version | 2.0 |
Author | Greg Perham |
Rating | 0 |
Last updated | 2014-10-24 02:43:00 |
Downloads |
95
|
Download Plugins Speed Test plugin for Wordpress |
Home page PageSpeed score has been degraded by 0%, while Post page PageSpeed score has been degraded by 0%
Priority Shortcodes plugin added 3 bytes of resources to the Home page and 28 bytes of resources to the sample Post page.
Priority Shortcodes plugin added 0 new host(s) to the Home page and 0 new host(s) to the sample Post page.
Great! Priority Shortcodes plugin ads no tables to your Wordpress blog database.Ever get annoyed or frustrated by the way TinyMCE+wpautop+do_shortcode wreak havoc on your shortcodes, wrapping <p>
s around <div>
s, leaving orphan </p>
s, and all sorts of craziness? This plugin allows you to specify shortcodes to be processed before those other actions, generating the clean code you expected.
Priority Shortcodes works by adding an action to the_content
and widget_text
hooks with a higher priority than wpautop
and do_shortcode
. The result is that those other actions run your shortcode's final output, rather than trying to guess if it should be wrapped in <p>
tags, etc.
The Codex says:
wpautop recognizes shortcode syntax and will attempt not to wrap p or br tags around shortcodes that stand alone on a line by themselves. Shortcodes intended for use in this manner should ensure that the output is wrapped in an appropriate block tag such as
<p>
or<div>
.
But sometimes shortcodes stand on their own on a line, wanting desperately to be wrapped in a paragraph tag, and sometimes they don't. Like a shortcode that generates a <span>
tag with some classes. (Yeah, you might want to use custom TinyMCE styles instead for a simple span.)
Where you want to process a shortcode with priority, use "[!" at the start. For example: [my-shortcode]
becomes [!my-shortcode]
and [my-shortcode]Some content.[/my-shortcode]
becomes [!my-shortcode]Some content.[/my-shortcode]
.