Title: Priority Shortcodes
Author: swinggraphics
Published: <strong>2014-يىلى 20-سېنتەبىر</strong>
Last modified: 2024-يىلى 15-ئاپرېل

---

قىستۇرما ئىزدە

This plugin **hasn’t been tested with the latest 3 major releases of WordPress**.
It may no longer be maintained or supported and may have compatibility issues when
used with more recent versions of WordPress.

![](https://ps.w.org/priority-shortcodes/assets/icon-256x256.png?rev=2439220)

# Priority Shortcodes

 يازغۇچى [swinggraphics](https://profiles.wordpress.org/swinggraphics/)

[چۈشۈر](https://downloads.wordpress.org/plugin/priority-shortcodes.zip)

 * [تەپسىلاتلار](https://ug.wordpress.org/plugins/priority-shortcodes/#description)
 * [باھالاشلار](https://ug.wordpress.org/plugins/priority-shortcodes/#reviews)
 *  [ئورنىتىش](https://ug.wordpress.org/plugins/priority-shortcodes/#installation)
 * [ئىجادىيەت](https://ug.wordpress.org/plugins/priority-shortcodes/#developers)

 [قوللاش](https://wordpress.org/support/plugin/priority-shortcodes/)

## چۈشەندۈرۈش

_Intended for use with the Classic Editor plugin._

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](https://codex.wordpress.org/Shortcode_API#Output):

> 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](https://codex.wordpress.org/TinyMCE_Custom_Styles)
instead for a simple span.)_

#### Usage

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]`.

#### Gutenberg

Users of the new WordPress editor, «Gutenberg», will probably not use Priority Shortcodes
within the new editor, but the plugin continues to work in the Classic Editor.

## ئورنىتىش

See the standard installation instructions at [WordPress.org](https://codex.wordpress.org/Managing_Plugins#Installing_Plugins)
or [WPBeginner](http://www.wpbeginner.com/beginners-guide/step-by-step-guide-to-install-a-wordpress-plugin-for-beginners/).

I expect developers will copy the code directly into their functions.php files, 
possibly customizing the string to specify the priority shortcodes.

## FAQ

### Does this affect all shortcodes?

No. See «Usage» above.

### Should I use this everywhere instead of the normal shortcodes?

No. Only use it on shortcodes that are being messed up.

### How does it work?

The plugin adds an action hook to `the_content` with priority 9, before `wpautop`
and `do_shortcode`, which run with normal priority 10. The function that runs in
our action hook is basically a copy/mashup of `do_shortcode()` and `do_shortcode_tag()`
with a custom regular expression. That regex pulled using `get_shortcode_regex()`,
so any updates to that expression in core will be respected by this plugin. See 
[shortcodes.php](https://core.trac.wordpress.org/browser/tags/4.0/src/wp-includes/shortcodes.php#L0)

### Why not just change the order wpautop and do_shortcode run in?

That can mess up other shortcodes. Plus, I’ve tried it, and it doesn’t have the 
result I wanted at all.

## باھالاشلار

![](https://secure.gravatar.com/avatar/8df0c37215db101da938ee567a5de64a409dc6b3e8e5463f92d5d6f9daba1580?
s=60&d=retro&r=g)

### 󠀁[Pure Garbage](https://wordpress.org/support/topic/pure-garbage-7/)󠁿

 [Chris](https://profiles.wordpress.org/nutlog13/) 2022-يىلى 13-دېكابىر

This plugin has a fatal flaw for me so I’m giving it a 1/5, from me. Karma sucks!

 [ 0 باھالاشنىڭ ھەممىنى ئوقۇش ](https://wordpress.org/support/plugin/priority-shortcodes/reviews/)

## تۆھپىكار ۋە ئىجادكار

«Priority Shortcodes» كودى ئوچۇق يۇمشاق دېتال. تۆۋەندىكى كىشىلەر بۇ قىستۇرمىغا تۆھپە
قوشقان.

تۆھپىكار

 *   [ swinggraphics ](https://profiles.wordpress.org/swinggraphics/)

[«Priority Shortcodes» نى تىلىڭىزغا تەرجىمە قىلىڭ](https://translate.wordpress.org/projects/wp-plugins/priority-shortcodes)

### ئىجادىيەتكە قىزىقامسىز؟

[كودقا كۆز يۈگۈرتۈپ](https://plugins.trac.wordpress.org/browser/priority-shortcodes/)،
[SVN خەزىنە](https://plugins.svn.wordpress.org/priority-shortcodes/) تەكشۈرۈپ ياكى
[RSS](https://plugins.trac.wordpress.org/log/priority-shortcodes/?limit=100&mode=stop_on_copy&format=rss)
ئارقىلىق [ئىجادىيەت خاتىرىسى](https://plugins.trac.wordpress.org/log/priority-shortcodes/)
گە مۇشتەرى بولغىلى بولىدۇ.

## ئۆزگىرىش خاتىرىسى

#### 2.0.2

 * Tested with WP 5.6
 * Updated README with note about Gutenberg

#### 2.0.1

 * Bumped «Tested up to» version

#### 2.0

 * Changed to more simple `[!` syntax
 * Added compatibility with text widgets

#### 1.0

 * Initial release

## Meta

 *  Version **2.0.2**
 *  ئاخىرقى يېڭىلانغان ۋاقىت **2 يىل بۇرۇن**
 *  ئاكتىپ ئورنىتىش سانى **10+**
 *  WordPress نەشرى ** 2.5.0 ياكى يۇقىرى **
 *  **6.5.8** دا سىنالغان
 *  تىل
 * [English (US)](https://wordpress.org/plugins/priority-shortcodes/)
 * بەلگە
 * [classic editor](https://ug.wordpress.org/plugins/tags/classic-editor/)[shortcodes](https://ug.wordpress.org/plugins/tags/shortcodes/)
   [tinyMCE](https://ug.wordpress.org/plugins/tags/tinymce/)
 *  [ئالىي كۆرۈنۈش](https://ug.wordpress.org/plugins/priority-shortcodes/advanced/)

## دەرىجە

 1/5 يۇلتۇز

 *  [  0 5-star reviews     ](https://wordpress.org/support/plugin/priority-shortcodes/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/priority-shortcodes/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/priority-shortcodes/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/priority-shortcodes/reviews/?filter=2)
 *  [  1 1-star review     ](https://wordpress.org/support/plugin/priority-shortcodes/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/priority-shortcodes/reviews/#new-post)

[بارلىق ئىنكاسنى كۆرسەت](https://wordpress.org/support/plugin/priority-shortcodes/reviews/)

## تۆھپىكار

 *   [ swinggraphics ](https://profiles.wordpress.org/swinggraphics/)

## قوللاش

چۈشەندۈرۈشىڭىز بارمۇ؟ ياردەم لازىممۇ؟

 [قوللاش مۇنبىرىنى كۆرسەت](https://wordpress.org/support/plugin/priority-shortcodes/)