Changes between Initial Version and Version 1 of Ticket #60948
- Timestamp:
- 04/06/2024 07:24:00 PM (10 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Ticket #60948
-
Property
Component
changed from
General
toShortcodes
-
Property
Component
changed from
-
Ticket #60948 – Description
initial v1 1 1 shortcodes that return with no value / text will break if shortcode is being used as an attribute value. Shortcode works in this scenario if there is text / value returned. 2 2 3 eg: <input type="email" class="regular-text ltr form-required" id="imok_contact_email_1" 3 eg: 4 {{{ 5 <input type="email" class="regular-text ltr form-required" id="imok_contact_email_1" 4 6 name="imok_contact_email_1" value=[imok_contact_email_1] title="Please enter a valid email address." required> 7 }}} 5 8 6 9 if [imok_contact_email_1] returns an empty string, the result of the input tag above is: 10 {{{ 7 11 <input type="email" class="regular-text ltr form-required" 8 12 id="imok_contact_email_1" name="imok_contact_email_1" 9 13 value= title="Please enter a valid email address." required> 14 }}} 10 15 11 16 This mangles the html output and the attribute for value becomes: 12 value="title="Please" 17 `value="title="Please"` 13 18 14 19 Placing the shortcode between quotes fails for the following reason: 15 See: https://core.trac.wordpress.org/ticket/3498320 See: #34983 16 21 17 Offending code is in shortcodes.php18 function do_shortcodes_in_html_tags22 Offending code is in `shortcodes.php` 23 function `do_shortcodes_in_html_tags` 19 24 line: 20 if ( '' !== trim( $new_attr ) ) { 25 `if ( '' !== trim( $new_attr ) ) {` 21 26 I am not sure why that line exists.