Make WordPress Core

Changeset 6911


Ignore:
Timestamp:
02/19/2008 06:52:30 AM (18 years ago)
Author:
ryan
Message:

Support positional attributes in shortcodes. Props tellyworth. fixes #5914

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/shortcodes.php

    r6801 r6911  
    9898function shortcode_parse_atts($text) {
    9999        $atts = array();
    100         $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)/';
     100        $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
    101101        if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
    102102                foreach ($match as $m) {
     
    107107                        elseif (!empty($m[5]))
    108108                                $atts[strtolower($m[5])] = stripcslashes($m[6]);
     109                        elseif (isset($m[7]) and strlen($m[7]))
     110                                $atts[] = stripcslashes($m[7]);
     111                        elseif (isset($m[8]))
     112                                $atts[] = stripcslashes($m[8]);
    109113                }
    110114        }
Note: See TracChangeset for help on using the changeset viewer.