FrmShortcodeHelper.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 2.05.09, at classes/helpers/FrmShortcodeHelper.php
| 1 | <?php |
| 2 | /** |
| 3 | * @since 2.02.12 |
| 4 | */ |
| 5 | |
| 6 | class FrmShortcodeHelper { |
| 7 | |
| 8 | /** |
| 9 | * Get the shortcode attributes in key/value pairs from a string |
| 10 | * |
| 11 | * @since 2.02.12 |
| 12 | * @param string $text |
| 13 | * |
| 14 | * @return array |
| 15 | */ |
| 16 | public static function get_shortcode_attribute_array( $text ) { |
| 17 | $atts = array(); |
| 18 | if ( $text !== '' ) { |
| 19 | $atts = shortcode_parse_atts( $text ); |
| 20 | } |
| 21 | |
| 22 | if ( ! is_array( $atts ) ) { |
| 23 | $atts = array(); |
| 24 | } |
| 25 | |
| 26 | return $atts; |
| 27 | } |
| 28 | } |
| 29 |