WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 2 years ago

#33847 closed enhancement (wontfix)

add_shortcode enhancement request for optional priority

Reported by: opajaap Owned by:
Milestone: Priority: normal
Severity: normal Version:
Component: Formatting Keywords:
Focuses: Cc:

Description

The request is to add $priority as argumant to ad_shortcode so that it will look like:

<?php add_shortcode( $tag, $func, $priority ); ?>

The $priority argument ( integer ) should be optional and default to the wp system setting, currently being 11.

This will enable plugin writers to decide if the output of $func will pass through the content filters like wpautop or not, by setting the priority either lower or higher than 10, hence giving the plugin author the control over this issue without generating possible conflicts with other shortcodes or filters.

This will make an end to the discussion whether to change the do_shortcode() priority, see https://make.wordpress.org/core/2015/09/04/shortcode-roadmap-extended-discussion/#comments

Change History (2)

#1 @dd32
6 years ago

  • Component changed from General to Formatting

Due to the way that shortcodes are implemented, adding a $priority parameter doesn't seem like it's possible, or advisable.

#2 @pento
2 years ago

  • Resolution set to wontfix
  • Status changed from new to closed

This would only make the shortcode handling code exponentially more complex, there's no way we could safely and responsibly implement this.

Note: See TracTickets for help on using tickets.