mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-04-05 05:04:31 +00:00
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. git-svn-id: https://develop.svn.wordpress.org/trunk@46554 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -488,9 +488,8 @@ function get_shortcode_atts_regex() {
|
||||
* retrieval of the attributes, since all attributes have to be known.
|
||||
*
|
||||
* @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.
|
||||
* Returns empty array if trim( $text ) == '""'.
|
||||
* Returns empty string if trim( $text ) == ''.
|
||||
@@ -499,13 +498,7 @@ function get_shortcode_atts_regex() {
|
||||
function shortcode_parse_atts( $text ) {
|
||||
$atts = array();
|
||||
$pattern = get_shortcode_atts_regex();
|
||||
$text = trim( preg_replace( "/[\x{00a0}\x{200b}]+/u", ' ', $text ) );
|
||||
|
||||
// Remove everything but attributes from shortcode.
|
||||
if ( preg_match( '#^\[[\w-]+([^\]]*?)\/?\]#', $text, $matches ) ) {
|
||||
$text = $matches[1];
|
||||
}
|
||||
|
||||
$text = preg_replace( "/[\x{00a0}\x{200b}]+/u", ' ', $text );
|
||||
if ( preg_match_all( $pattern, $text, $match, PREG_SET_ORDER ) ) {
|
||||
foreach ( $match as $m ) {
|
||||
if ( ! empty( $m[1] ) ) {
|
||||
|
||||
Reference in New Issue
Block a user