Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions classes/controllers/FrmEntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -374,7 +374,7 @@ public static function update_hidden_cols( $meta_id, $object_id, $meta_key, $met

global $frm_vars;

if ( ! isset( $frm_vars['prev_hidden_cols'] ) || ! $frm_vars['prev_hidden_cols'] ) {
if ( empty( $frm_vars['prev_hidden_cols'] ) ) {
// Don't continue if there's no previous value.
return;
}
Expand Down Expand Up @@ -728,7 +728,7 @@ public static function destroy() {

$params = FrmForm::get_admin_params();

if ( isset( $params['keep_post'] ) && $params['keep_post'] ) {
if ( ! empty( $params['keep_post'] ) ) {
self::unlink_post( $params['id'] );
}

Expand Down Expand Up @@ -870,7 +870,7 @@ private static function _delete_entry( $entry_id, $form ) {

FrmAppHelper::unserialize_or_decode( $form->options );

if ( isset( $form->options['no_save'] ) && $form->options['no_save'] ) {
if ( ! empty( $form->options['no_save'] ) ) {
self::unlink_post( $entry_id );
FrmEntry::destroy( $entry_id );
}
Expand Down
4 changes: 2 additions & 2 deletions classes/controllers/FrmFormActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ private static function active_actions( $action_controls ) {
$allowed = array();

foreach ( $action_controls as $action_control ) {
if ( isset( $action_control->action_options['active'] ) && $action_control->action_options['active'] ) {
if ( ! empty( $action_control->action_options['active'] ) ) {
$allowed[] = $action_control->id_base;
}
}
Expand Down Expand Up @@ -279,7 +279,7 @@ public static function show_action_icon_link( $action_control, $allowed ) {
$default_position = array_search( $action_control->id_base, $default_shown, true );
$allowed_count = count( $allowed );

if ( isset( $action_control->action_options['active'] ) && $action_control->action_options['active'] ) {
if ( ! empty( $action_control->action_options['active'] ) ) {
$classes .= ' frm_active_action';
} else {
$classes .= ' frm_inactive_action';
Expand Down
2 changes: 1 addition & 1 deletion classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1193,7 +1193,7 @@ public static function replace_relative_url( $css ) {
public static function enqueue_style() {
global $frm_vars;

if ( isset( $frm_vars['css_loaded'] ) && $frm_vars['css_loaded'] ) {
if ( ! empty( $frm_vars['css_loaded'] ) ) {
// The CSS has already been loaded.
return;
}
Expand Down
2 changes: 1 addition & 1 deletion classes/factories/FrmFieldFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public static function create_field_value_selector( $field_id, $args ) {
public static function get_field_factory( $field ) {
if ( is_object( $field ) ) {
$field_info = self::get_field_object( $field );
} elseif ( isset( $field['id'] ) && $field['id'] ) {
} elseif ( ! empty( $field['id'] ) ) {
$field_info = self::get_field_object( $field['id'] );
} else {
$field_info = self::get_field_type( $field['type'], $field );
Expand Down
6 changes: 3 additions & 3 deletions classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2913,7 +2913,7 @@ private static function fill_field_defaults( $field, $record, array &$values, $a

if ( $args['default'] ) {
$meta_value = $field->default_value;
} elseif ( $record->post_id && self::pro_is_installed() && isset( $field->field_options['post_field'] ) && $field->field_options['post_field'] ) {
} elseif ( $record->post_id && self::pro_is_installed() && ! empty( $field->field_options['post_field'] ) ) {
if ( ! isset( $field->field_options['custom_field'] ) ) {
$field->field_options['custom_field'] = '';
}
Expand Down Expand Up @@ -2951,7 +2951,7 @@ private static function fill_field_defaults( $field, $record, array &$values, $a

FrmFieldsHelper::prepare_edit_front_field( $field_array, $field, $values['id'], $args );

if ( ! isset( $field_array['unique'] ) || ! $field_array['unique'] ) {
if ( empty( $field_array['unique'] ) ) {
$field_array['unique_msg'] = '';
}

Expand Down Expand Up @@ -3274,7 +3274,7 @@ public static function human_time_diff( $from, $to = '', $levels = 1 ) {
}

foreach ( $time_strings as $k => $v ) {
if ( isset( $diff[ $k ] ) && $diff[ $k ] ) {
if ( ! empty( $diff[ $k ] ) ) {
$time_strings[ $k ] = $diff[ $k ] . ' ' . ( $diff[ $k ] > 1 ? $v[1] : $v[0] );
} elseif ( isset( $diff[ $k ] ) && count( $time_strings ) === 1 ) {
// Account for 0.
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmEntriesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ public static function value_is_posted( $field, $args ) {
$value_is_posted = false;

if ( $_POST ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
$repeating = isset( $args['repeating'] ) && $args['repeating'];
$repeating = ! empty( $args['repeating'] );

if ( $repeating ) {
if ( isset( $_POST['item_meta'][ $args['parent_field_id'] ][ $args['key_pointer'] ][ $field->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing
Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -669,7 +669,7 @@ public static function is_placeholder_field_type( $type ) {
public static function get_checkbox_id( $field, $opt_key, $type = 'checkbox' ) {
$id = $field['id'];

if ( isset( $field['in_section'] ) && $field['in_section'] && ! FrmAppHelper::is_admin_page( 'formidable' ) ) {
if ( ! empty( $field['in_section'] ) && ! FrmAppHelper::is_admin_page( 'formidable' ) ) {
$id .= '-' . $field['in_section'];
}

Expand Down
2 changes: 1 addition & 1 deletion classes/helpers/FrmFormsListHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ public function single_row( $item, $style = '' ) {
$val = '<abbr title="' . esc_attr( gmdate( 'Y/m/d g:i:s A', strtotime( $item->created_at ) ) ) . '">' . $date . '</abbr>';
break;
case 'entries':
if ( isset( $item->options['no_save'] ) && $item->options['no_save'] ) {
if ( ! empty( $item->options['no_save'] ) ) {
$val = FrmAppHelper::icon_by_class(
'frmfont frm_forbid_icon frm_bstooltip',
array(
Expand Down
6 changes: 3 additions & 3 deletions classes/helpers/FrmXMLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -1959,7 +1959,7 @@ public static function migrate_form_settings_to_actions( $form_options, $form_id
* @param bool $switch
*/
private static function migrate_post_settings_to_action( $form_options, $form_id, $post_type, &$imported, $switch ) {
if ( ! isset( $form_options['create_post'] ) || ! $form_options['create_post'] ) {
if ( empty( $form_options['create_post'] ) ) {
return;
}

Expand Down Expand Up @@ -2196,7 +2196,7 @@ private static function migrate_notifications_to_action( $form_options, $form_id
// Format the email data
self::format_email_data( $atts, $notification );

if ( isset( $notification['twilio'] ) && $notification['twilio'] ) {
if ( ! empty( $notification['twilio'] ) ) {
do_action( 'frm_create_twilio_action', $atts, $notification );
}

Expand Down Expand Up @@ -2357,7 +2357,7 @@ private static function switch_email_condition_field_ids( &$post_content ) {
* @return void
*/
private static function migrate_autoresponder_to_action( $form_options, $form_id, &$notifications ) {
if ( isset( $form_options['auto_responder'] ) && $form_options['auto_responder'] && isset( $form_options['ar_email_message'] ) && $form_options['ar_email_message'] ) {
if ( ! empty( $form_options['auto_responder'] ) && ! empty( $form_options['ar_email_message'] ) ) {
// migrate autoresponder

$email_field = $form_options['ar_email_to'] ?? 0;
Expand Down
10 changes: 5 additions & 5 deletions classes/models/FrmEntryFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ protected function init_array_key( $atts ) {
* @return void
*/
protected function init_is_plain_text( $atts ) {
if ( isset( $atts['plain_text'] ) && $atts['plain_text'] ) {
if ( ! empty( $atts['plain_text'] ) ) {
$this->is_plain_text = true;
} elseif ( $atts['format'] !== 'text' ) {
$this->is_plain_text = true;
Expand All @@ -264,7 +264,7 @@ protected function init_is_plain_text( $atts ) {
* @return void
*/
protected function init_include_blank( $atts ) {
if ( isset( $atts['include_blank'] ) && $atts['include_blank'] ) {
if ( ! empty( $atts['include_blank'] ) ) {
$this->include_blank = true;
}
}
Expand Down Expand Up @@ -294,7 +294,7 @@ protected function init_direction( $atts ) {
* @return void
*/
protected function init_include_user_info( $atts ) {
if ( isset( $atts['user_info'] ) && $atts['user_info'] ) {
if ( ! empty( $atts['user_info'] ) ) {
$this->include_user_info = true;
}
}
Expand All @@ -320,7 +320,7 @@ protected function skip_fields() {
* @return void
*/
protected function init_include_extras( $atts ) {
if ( isset( $atts['include_extras'] ) && $atts['include_extras'] ) {
if ( ! empty( $atts['include_extras'] ) ) {
$this->include_extras = array_map( 'strtolower', array_map( 'trim', explode( ',', $atts['include_extras'] ) ) );
}
}
Expand Down Expand Up @@ -359,7 +359,7 @@ protected function init_table_generator( $atts ) {
* @return void
*/
protected function init_is_clickable( $atts ) {
if ( isset( $atts['clickable'] ) && $atts['clickable'] ) {
if ( ! empty( $atts['clickable'] ) ) {
$this->is_clickable = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmEntryShortcodeFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ protected function init_fields() {
* @return void
*/
protected function init_plain_text( $atts ) {
if ( isset( $atts['plain_text'] ) && $atts['plain_text'] ) {
if ( ! empty( $atts['plain_text'] ) ) {
$this->is_plain_text = true;
}
}
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmField.php
Original file line number Diff line number Diff line change
Expand Up @@ -1440,7 +1440,7 @@ public static function is_option_true_in_array( $field, $option ) {
* @return bool
*/
public static function is_option_true_in_object( $field, $option ) {
return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ];
return ! empty( $field->field_options[ $option ] );
}

/**
Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmFieldFormHtml.php
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ private function get_field_div_classes() {
// Add label position class
$settings = $this->field_obj->display_field_settings();

if ( isset( $settings['label_position'] ) && $settings['label_position'] ) {
if ( ! empty( $settings['label_position'] ) ) {
$label_position = $this->field_obj->get_field_column( 'label' );
$classes .= ' frm_' . $label_position . '_container';

Expand Down
2 changes: 1 addition & 1 deletion classes/models/FrmSolution.php
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ protected function step_top( $step ) {
<section class="step step-install <?php echo esc_attr( $section_class ); ?>">
<aside class="num">
<?php
if ( isset( $step['complete'] ) && $step['complete'] ) {
if ( ! empty( $step['complete'] ) ) {
FrmAppHelper::icon_by_class(
'frmfont frm_step_complete_icon',
array(
Expand Down
2 changes: 1 addition & 1 deletion classes/models/fields/FrmFieldType.php
Original file line number Diff line number Diff line change
Expand Up @@ -993,7 +993,7 @@ public function show_field( $args ) {
* @return void
*/
protected function get_field_scripts_hook( $args ) {
$form_id = isset( $args['parent_form_id'] ) && $args['parent_form_id'] ? $args['parent_form_id'] : $args['form']->id;
$form_id = ! empty( $args['parent_form_id'] ) ? $args['parent_form_id'] : $args['form']->id;
do_action( 'frm_get_field_scripts', $this->field, $args['form'], $form_id );
}

Expand Down
2 changes: 1 addition & 1 deletion classes/views/frm-entries/no_entries.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
}
?>
<div class="frmcenter frm_no_entries_form frm_placeholder_block">
<?php if ( $form && isset( $form->options['no_save'] ) && $form->options['no_save'] ) { ?>
<?php if ( $form && ! empty( $form->options['no_save'] ) ) { ?>
<h3><?php esc_html_e( 'This form is not set to save any entries.', 'formidable' ); ?></h3>
<p>
<?php
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class="frm-has-modal frm-default-value-wrapper default-value-section-<?php echo

<span class="frm-flex-col frm-with-right-icon">
<?php
if ( isset( $display['default_value'] ) && $display['default_value'] ) {
if ( ! empty( $display['default_value'] ) ) {
$default_name = 'field_options[dyn_default_value_' . $field['id'] . ']';
$default_value = $field['dyn_default_value'] ?? '';
} else {
Expand Down
2 changes: 1 addition & 1 deletion classes/views/frm-fields/single-option.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@

?>
<?php if ( in_array( $default_type, array( 'radio', 'checkbox' ), true ) ) : ?>
<input type="<?php echo esc_attr( $default_type ); ?>" name="<?php echo esc_attr( $field_name ); ?>" <?php echo ( isset( $checked ) && $checked ? 'checked="checked"' : '' ); ?> value="<?php echo esc_attr( $field_val ); ?>"/>
<input type="<?php echo esc_attr( $default_type ); ?>" name="<?php echo esc_attr( $field_name ); ?>" <?php echo ( ! empty( $checked ) ? 'checked="checked"' : '' ); ?> value="<?php echo esc_attr( $field_val ); ?>"/>
<?php endif; ?>

<input type="text" name="field_options[options_<?php echo esc_attr( $field['id'] ); ?>][<?php echo esc_attr( $opt_key ); ?>][label]" value="<?php echo esc_attr( $opt ); ?>" class="field_<?php echo esc_attr( $field['id'] ); ?>_option <?php echo esc_attr( $field['separate_value'] ? 'frm_with_key' : '' ); ?>" id="<?php echo esc_attr( $html_id . '-' . $opt_key . '-label' ); ?>" data-frmchange="trim,updateOption,checkUniqueOpt" />
Expand Down
2 changes: 1 addition & 1 deletion classes/views/frm-forms/_publish_box.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</button>

<div id="frm-preview-action">
<?php if ( ( ! isset( $hide_preview ) || ! $hide_preview ) && isset( $values['form_key'] ) ) { ?>
<?php if ( empty( $hide_preview ) && isset( $values['form_key'] ) ) { ?>
<div class="preview dropdown">
<a href="#" id="frm-previewDrop" class="frm-dropdown-toggle button frm-button-secondary" role="button">
<?php esc_html_e( 'Preview', 'formidable' ); ?>
Expand Down
2 changes: 1 addition & 1 deletion css/_single_theme.css.php
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@
background-color:var(--bg-color-active)<?php echo esc_html( $important ); ?>;
border-color:var(--border-color-active)<?php echo esc_html( $important ); ?>;
color:var(--text-color);
<?php if ( isset( $remove_box_shadow_active ) && $remove_box_shadow_active ) { ?>
<?php if ( ! empty( $remove_box_shadow_active ) ) { ?>
box-shadow:none;
outline: none;
<?php } else { ?>
Expand Down
Loading