Make WordPress Core

Opened 2 months ago

Last modified 8 weeks ago

#60829 new enhancement

Improve shortcode support for link fields

Reported by: code-muffin's profile Code Muffin Owned by:
Milestone: Awaiting Review Priority: normal
Severity: normal Version:
Component: Editor Keywords:
Focuses: Cc:

Description

Using a shortcode in a link field currently prepends http:// to the field. They still render on the frontend, but this makes them functionally unusable because the resulting href is always prepended by that http://.

This is due to the JS function correctURL (in wp-includes/js/wplink.js), which adds it if the URL does not start with http:, https:, ? # or /.

I suggest adding [ to that list of allowed characters, so shortcodes can be used too.

Change History (1)

#1 @Code Muffin
8 weeks ago

  • Summary changed from Add shortcode support to link fields to Improve shortcode support for link fields
Note: See TracTickets for help on using tickets.