Make WordPress Core

Ticket #26927: 26927.2.patch

File 26927.2.patch, 1.3 KB (added by DrewAPicture, 11 years ago)

Better long description / wrapping

  • src/wp-includes/shortcodes.php

     
    286286/**
    287287 * Retrieve all attributes from the shortcodes tag.
    288288 *
    289  * The attributes list has the attribute name as the key and the value of the
    290  * attribute as the value in the key/value pair. This allows for easier
    291  * retrieval of the attributes, since all attributes have to be known.
     289 * Attributes are returned in key=value pairs as name=value, or index=value
     290 * if no name is supplied. If no attributes are passed in the shortcode,
     291 * an empty string will instead be returned.
    292292 *
    293293 * @since 2.5.0
    294294 *
    295295 * @param string $text
    296  * @return array List of attributes and their value.
     296 * @return array|string Array of attributes and their values, empty string
     297 *                      if no attributes were passed.
    297298 */
    298299function shortcode_parse_atts($text) {
    299300        $atts = array();
     
    307308                                $atts[strtolower($m[3])] = stripcslashes($m[4]);
    308309                        elseif (!empty($m[5]))
    309310                                $atts[strtolower($m[5])] = stripcslashes($m[6]);
    310                         elseif (isset($m[7]) and strlen($m[7]))
     311                        elseif (isset($m[7]) && strlen($m[7]))
    311312                                $atts[] = stripcslashes($m[7]);
    312313                        elseif (isset($m[8]))
    313314                                $atts[] = stripcslashes($m[8]);