PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / trunk
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More vtrunk
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/helpers/FrmShortcodeHelper.php +12 -20 6.26 → trunk View file →
@@ -23,13 +23,9 @@
23 23 if ( $text !== '' ) {
24 24 $atts = shortcode_parse_atts( $text );
25 25 }
26 26
27 - if ( ! is_array( $atts ) ) {
28 - $atts = array();
29 - }
30 -
31 - return $atts;
27 + return is_array( $atts ) ? $atts : array();
32 28 }
33 29
34 30 /**
35 31 * Returns shortcodes that are shown/hidden based on the context.
@@ -72,14 +68,14 @@
72 68 *
73 69 * @return array
74 70 */
75 71 public static function get_contextual_codes() {
76 - $contextual_shortcodes = self::get_contextual_shortcodes();
77 - $result = array();
72 + $result = array();
78 73
79 - foreach ( $contextual_shortcodes as $type => $shortcodes ) {
74 + foreach ( self::get_contextual_shortcodes() as $type => $shortcodes ) {
80 75 $result[ $type ] = array_keys( $shortcodes );
81 76 }
77 +
82 78 return $result;
83 79 }
84 80
85 81 /**
@@ -118,22 +114,18 @@
118 114 }
119 115
120 116 $with_tags = $args['conditional_check'] ? 3 : 2;
121 117
122 - if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) {
123 - $tag = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] );
124 - $tag = str_replace( ']', '', $tag );
125 - $tag = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag );
126 - $tags = preg_split( '/\s+/', $tag, 2 );
118 + if ( empty( $shortcodes[ $with_tags ][ $short_key ] ) ) {
119 + return $shortcodes[ $with_tags - 1 ][ $short_key ];
120 + }
127 121
128 - if ( is_array( $tags ) ) {
129 - $tag = $tags[0];
130 - }
131 - } else {
132 - $tag = $shortcodes[ $with_tags - 1 ][ $short_key ];
133 - }
122 + $tag = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] );
123 + $tag = str_replace( ']', '', $tag );
124 + $tag = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag );
125 + $tags = preg_split( '/\s+/', $tag, 2 );
134 126
135 - return $tag;
127 + return is_array( $tags ) ? $tags[0] : $tag;
136 128 }
137 129
138 130 /**
139 131 * @param bool $no_vars