You are here

function bs_attribute_map in Bootstrap 3 shortcodes 7

File

includes/functions.php, line 21

Code

function bs_attribute_map($str, $att = null) {
  $res = array();
  $return = array();
  $reg = get_shortcode_regex();
  preg_match_all('~' . $reg . '~', $str, $matches);
  foreach ($matches[2] as $key => $name) {
    $parsed = shortcode_parse_atts($matches[3][$key]);
    $parsed = is_array($parsed) ? $parsed : array();
    $res[$name] = $parsed;
    $return[] = $res;
  }
  return $return;
}