Plugin info

Total downloads: 1,796
Active installs: 10
Total reviews: 1
Average rating: 1
Support threads opened: 0
Support threads resolved: 0 (0%)
Available in: 1 language(s)
Contributors: 1
Last updated: 4/15/2024 (673 days ago)
Added to WordPress: 9/20/2014 (11 years old)
Minimum WordPress version: 2.5.0
Tested up to WordPress version: 6.5.7
Minimum PHP version: f

Maintenance & Compatibility

Maintenance score

Possibly abandoned • Last updated 673 days ago • 1 reviews

28/100

Is Priority Shortcodes abandoned?

Possibly abandoned (last update 673 days ago).

Compatibility

Requires WordPress: 2.5.0
Tested up to: 6.5.7
Requires PHP: f

Similar & Alternatives

Explore plugins with similar tags, and compare key metrics like downloads, ratings, updates, support, and WP/PHP compatibility.

TCD Classic Editor
Rating 0.0/5 (0 reviews)Active installs 2,000
Classic Editor
Rating 4.9/5 (1,212 reviews)Active installs 9,000,000
Advanced Editor Tools
Rating 4.5/5 (350 reviews)Active installs 2,000,000
Disable Gutenberg
Rating 5.0/5 (726 reviews)Active installs 600,000
Classic Editor +
Rating 4.9/5 (31 reviews)Active installs 50,000
Enlighter – Customizable Syntax Highlighter
Rating 4.8/5 (65 reviews)Active installs 10,000

Description

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

s around

s, leaving orphan

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

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

or

.

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 tag with some classes. (Yeah, you might want to use custom TinyMCE 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.

Installation

See the standard installation instructions at WordPress.org or WPBeginner.

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

Frequently Asked Questions

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

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.

Review feed

No reviews available

Screenshots

No screenshots available

Changelog

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