// Is there a closing XHTML slash at the end of the attributes?
if ( 1 ===
preg_match( '%\s*/\s*$%',
$attr,
$matches ) ) { $xhtml_slash =
$matches[0
];
$attr =
substr( $attr, 0, -
strlen( $xhtml_slash ) );
} else { $xhtml_slash = '';
} // Split it.
$attrarr =
wp_kses_hair_parse( $attr );
if ( false ===
$attrarr ) { return false;
} // Make sure all input is returned by adding front and back matter.
array_unshift( $attrarr,
$begin .
$slash .
$elname );
array_push( $attrarr,
$xhtml_slash .
$end );
return $attrarr;
}