Make WordPress Core


Ignore:
Timestamp:
07/07/2015 11:58:49 PM (9 years ago)
Author:
johnbillion
Message:

Allow shortcode parameter names (attributes) to contain dashes.

Props aaroncampbell, tyxla, izem
Fixes #9405

File:
1 edited

Legend:

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

    r32867 r33118  
    310310function shortcode_parse_atts($text) {
    311311    $atts = array();
    312     $pattern = '/(\w+)\s*=\s*"([^"]*)"(?:\s|$)|(\w+)\s*=\s*\'([^\']*)\'(?:\s|$)|(\w+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
     312    $pattern = '/([\w-]+)\s*=\s*"([^"]*)"(?:\s|$)|([\w-]+)\s*=\s*\'([^\']*)\'(?:\s|$)|([\w-]+)\s*=\s*([^\s\'"]+)(?:\s|$)|"([^"]*)"(?:\s|$)|(\S+)(?:\s|$)/';
    313313    $text = preg_replace("/[\x{00a0}\x{200b}]+/u", " ", $text);
    314314    if ( preg_match_all($pattern, $text, $match, PREG_SET_ORDER) ) {
Note: See TracChangeset for help on using the changeset viewer.