PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.18
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.18
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 +19 -26 6.316.18 View file →
@@ -18,14 +18,17 @@
18 18 * @return array
19 19 */
20 20 public static function get_shortcode_attribute_array( $text ) {
21 21 $atts = array();
22 -
23 22 if ( $text !== '' ) {
24 23 $atts = shortcode_parse_atts( $text );
25 24 }
26 25
27 - return is_array( $atts ) ? $atts : array();
26 + if ( ! is_array( $atts ) ) {
27 + $atts = array();
28 + }
29 +
30 + return $atts;
28 31 }
29 32
30 33 /**
31 34 * Returns shortcodes that are shown/hidden based on the context.
@@ -30,9 +33,8 @@
30 33 /**
31 34 * Returns shortcodes that are shown/hidden based on the context.
32 35 *
33 36 * @since 6.16.3
34 - *
35 37 * @return array
36 38 */
37 39 public static function get_contextual_shortcodes() {
38 40 return array(
@@ -68,14 +70,13 @@
68 70 *
69 71 * @return array
70 72 */
71 73 public static function get_contextual_codes() {
72 - $result = array();
73 -
74 - foreach ( self::get_contextual_shortcodes() as $type => $shortcodes ) {
74 + $contextual_shortcodes = self::get_contextual_shortcodes();
75 + $result = array();
76 + foreach ( $contextual_shortcodes as $type => $shortcodes ) {
75 77 $result[ $type ] = array_keys( $shortcodes );
76 78 }
77 -
78 79 return $result;
79 80 }
80 81
81 82 /**
@@ -97,15 +98,13 @@
97 98 'conditional_check' => false,
98 99 'foreach' => false,
99 100 )
100 101 );
101 -
102 102 if ( ( $args['conditional'] || $args['foreach'] ) && ! $args['conditional_check'] ) {
103 103 $args['conditional_check'] = true;
104 104 }
105 105
106 106 $prefix = '';
107 -
108 107 if ( $args['conditional_check'] ) {
109 108 if ( $args['conditional'] ) {
110 109 $prefix = 'if ';
111 110 } elseif ( $args['foreach'] ) {
@@ -113,29 +112,23 @@
113 112 }
114 113 }
115 114
116 115 $with_tags = $args['conditional_check'] ? 3 : 2;
117 -
118 - if ( empty( $shortcodes[ $with_tags ][ $short_key ] ) ) {
119 - return $shortcodes[ $with_tags - 1 ][ $short_key ];
116 + if ( ! empty( $shortcodes[ $with_tags ][ $short_key ] ) ) {
117 + $tag = str_replace( '[' . $prefix, '', $shortcodes[0][ $short_key ] );
118 + $tag = str_replace( ']', '', $tag );
119 + $tag = str_replace( chr( 194 ) . chr( 160 ), ' ', $tag );
120 + $tags = preg_split( '/\s+/', $tag, 2 );
121 + if ( is_array( $tags ) ) {
122 + $tag = $tags[0];
123 + }
124 + } else {
125 + $tag = $shortcodes[ $with_tags - 1 ][ $short_key ];
120 126 }
121 127
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 );
126 -
127 - return is_array( $tags ) ? $tags[0] : $tag;
128 + return $tag;
128 129 }
129 130
130 - /**
131 - * @param bool $no_vars
132 - * @param string $code
133 - * @param string $replace_with
134 - * @param string $html
135 - *
136 - * @return void
137 - */
138 131 public static function remove_inline_conditions( $no_vars, $code, $replace_with, &$html ) {
139 132 if ( $no_vars ) {
140 133 $html = str_replace( '[if ' . $code . ']', '', $html );
141 134 $html = str_replace( '[/if ' . $code . ']', '', $html );