[wp-trac] [WordPress Trac] #60829: Add shortcode support to link fields

WordPress Trac noreply at wordpress.org
Fri Mar 22 16:55:25 UTC 2024


#60829: Add shortcode support to link fields
-------------------------+-----------------------------
 Reporter:  Code Muffin  |      Owner:  (none)
     Type:  enhancement  |     Status:  new
 Priority:  normal       |  Milestone:  Awaiting Review
Component:  Editor       |    Version:
 Severity:  normal       |   Keywords:
  Focuses:               |
-------------------------+-----------------------------
 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
 [https://github.com/WordPress/wordpress-develop/blob/4.4/src/wp-
 includes/js/wplink.js#L88 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.

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/60829>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list