Shortcodes: Revert [46369] for now to allow more time to investigate and prepare for backward compatibility changes.

Also reverts follow-up changes in [46370] and [46465].

See #47863.
Built from https://develop.svn.wordpress.org/trunk@46554


git-svn-id: http://core.svn.wordpress.org/trunk@46351 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Sergey Biryukov 2019-10-15 19:36:02 +00:00
parent f7968ccb92
commit b052bca67e
2 changed files with 3 additions and 10 deletions

View File

@ -488,9 +488,8 @@ function get_shortcode_atts_regex() {
* retrieval of the attributes, since all attributes have to be known. * retrieval of the attributes, since all attributes have to be known.
* *
* @since 2.5.0 * @since 2.5.0
* @since 5.3.0 Added support of a full shortcode input.
* *
* @param string $text Any single shortcode of any format or key/value pair string. * @param string $text
* @return array|string List of attribute values. * @return array|string List of attribute values.
* Returns empty array if trim( $text ) == '""'. * Returns empty array if trim( $text ) == '""'.
* Returns empty string if trim( $text ) == ''. * Returns empty string if trim( $text ) == ''.
@ -499,13 +498,7 @@ function get_shortcode_atts_regex() {
function shortcode_parse_atts( $text ) { function shortcode_parse_atts( $text ) {
$atts = array(); $atts = array();
$pattern = get_shortcode_atts_regex(); $pattern = get_shortcode_atts_regex();
$text = trim( preg_replace( "/[\x{00a0}\x{200b}]+/u", ' ', $text ) ); $text = preg_replace( "/[\x{00a0}\x{200b}]+/u", ' ', $text );
// Remove everything but attributes from shortcode.
if ( preg_match( '#^\[[\w-]+([^\]]*?)\/?\]#', $text, $matches ) ) {
$text = $matches[1];
}
if ( preg_match_all( $pattern, $text, $match, PREG_SET_ORDER ) ) { if ( preg_match_all( $pattern, $text, $match, PREG_SET_ORDER ) ) {
foreach ( $match as $m ) { foreach ( $match as $m ) {
if ( ! empty( $m[1] ) ) { if ( ! empty( $m[1] ) ) {

View File

@ -13,7 +13,7 @@
* *
* @global string $wp_version * @global string $wp_version
*/ */
$wp_version = '5.3-beta3-46553'; $wp_version = '5.3-beta3-46554';
/** /**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema. * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.