| @@ -60,8 +60,9 @@ | ||
| 60 | 60 | if ( FrmField::is_no_save_field( $f->type ) ) { |
| 61 | 61 | continue; |
| 62 | 62 | } |
| 63 | 63 | |
| 64 | + // phpcs:ignore Universal.Operators.StrictComparisons | |
| 64 | 65 | if ( $f->type === 'data' && ( ! isset( $f->field_options['data_type'] ) || $f->field_options['data_type'] === 'data' || $f->field_options['data_type'] == '' ) ) { |
| 65 | 66 | continue; |
| 66 | 67 | } |
| 67 | 68 | |
| @@ -88,8 +89,9 @@ | ||
| 88 | 89 | </div> |
| 89 | 90 | |
| 90 | 91 | <?php |
| 91 | 92 | $show_logic = ! empty( $cond_shortcodes ) && ! empty( $fields ); |
| 93 | + | |
| 92 | 94 | if ( $show_logic ) { |
| 93 | 95 | ?> |
| 94 | 96 | <div id="frm-conditionals" class="tabs-panel frm-text-grey-700 frm-px-xs"> |
| 95 | 97 | <div class="frm-h-stack-sm"> |
| @@ -195,8 +197,9 @@ | ||
| 195 | 197 | |
| 196 | 198 | <ul class="frm_code_list frm-full-hover frm-mt-0"> |
| 197 | 199 | <?php |
| 198 | 200 | $contextual_codes = FrmShortcodeHelper::get_contextual_codes(); |
| 201 | + | |
| 199 | 202 | foreach ( $entry_shortcodes as $skey => $sname ) { |
| 200 | 203 | if ( ! $skey ) { |
| 201 | 204 | echo '<li class="clear frm_block"></li>'; |
| 202 | 205 | continue; |
| @@ -203,11 +206,11 @@ | ||
| 203 | 206 | } |
| 204 | 207 | |
| 205 | 208 | $classes = 'frm-advanced-list'; |
| 206 | 209 | $classes .= in_array( $skey, array( 'siteurl', 'sitename', 'entry_count' ), true ) ? ' show_before_content show_after_content' : ''; |
| 207 | - $classes .= strpos( $skey, 'default-' ) === 0 ? ' hide_frm_not_email_subject' : ''; | |
| 210 | + $classes .= str_starts_with( $skey, 'default-' ) ? ' hide_frm_not_email_subject' : ''; | |
| 208 | 211 | |
| 209 | - if ( in_array( $skey, array_keys( $contextual_codes ), true ) ) { | |
| 212 | + if ( array_key_exists( $skey, $contextual_codes ) ) { | |
| 210 | 213 | $classes .= ' frm_hidden'; |
| 211 | 214 | } |
| 212 | 215 | |
| 213 | 216 | FrmFormsHelper::insert_code_html( |
| @@ -234,13 +237,9 @@ | ||
| 234 | 237 | <?php |
| 235 | 238 | } |
| 236 | 239 | |
| 237 | 240 | foreach ( $helper['codes'] as $code => $code_label ) { |
| 238 | - if ( isset( $uid ) ) { | |
| 239 | - $code = str_replace( '|user_id|', $uid, $code ); | |
| 240 | - } else { | |
| 241 | - $code = str_replace( '|user_id|', 'x', $code ); | |
| 242 | - } | |
| 241 | + $code = isset( $uid ) ? str_replace( '|user_id|', $uid, $code ) : str_replace( '|user_id|', 'x', $code ); | |
| 243 | 242 | $include_x = strpos( $code, ' ' ) ? '' : 'x '; |
| 244 | 243 | |
| 245 | 244 | if ( ! is_array( $code_label ) ) { |
| 246 | 245 | $code_label = array( |