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
4 changes: 1 addition & 3 deletions classes/controllers/FrmAddonsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -1251,12 +1251,10 @@ private static function get_addon_activation_response() {

$message = $activating_page ? __( 'Your plugin has been activated. Would you like to save and reload the page now?', 'formidable' ) : __( 'Your plugin has been activated.', 'formidable' );

$response = array(
return array(
'message' => $message,
'saveAndReload' => $activating_page,
);

return $response;
}

/**
Expand Down
8 changes: 2 additions & 6 deletions classes/controllers/FrmEmailStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,7 @@ private static function get_test_rich_text_email_content( $style_key, $table_row
</style>';
}

$wrapped_content .= '</head><body>' . $content . '</body></html>';

return $wrapped_content;
return $wrapped_content . ( '</head><body>' . $content . '</body></html>' );
}

/**
Expand Down Expand Up @@ -449,9 +447,7 @@ public static function wrap_email_message( $message ) {
// The message.
$new_message .= self::add_inline_css( 'a', 'color:' . $style_settings['link_color'] . ';', $message );

$new_message .= '</div></div></div>';

return $new_message;
return $new_message . '</div></div></div>';
}

/**
Expand Down
4 changes: 1 addition & 3 deletions classes/controllers/FrmFieldsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -704,9 +704,7 @@ private static function add_html_placeholder( $field, array &$add_html, array &$
* @return string
*/
private static function prepare_placeholder( $field ) {
$placeholder = $field['placeholder'] ?? '';

return $placeholder;
return $field['placeholder'] ?? '';
}

/**
Expand Down
4 changes: 1 addition & 3 deletions classes/controllers/FrmFormActionsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -793,9 +793,7 @@ public static function limit_by_type( $where ) {
return $where;
}

$where .= $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] );

return $where;
return $where . $wpdb->prepare( ' AND post_excerpt = %s ', $frm_vars['action_type'] );
}

/**
Expand Down
11 changes: 4 additions & 7 deletions classes/controllers/FrmFormsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -915,15 +915,14 @@ public static function bulk_trash( $ids ) {
'type' => 'request',
)
);
$message = sprintf(

return sprintf(
/* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */
_n( '%1$s form moved to the Trash. %2$sUndo%3$s', '%1$s forms moved to the Trash. %2$sUndo%3$s', $count, 'formidable' ),
$count,
'<a href="' . esc_url( wp_nonce_url( '?page=formidable&frm_action=list&action=bulk_untrash&form_type=' . $current_page . '&item-action=' . implode( ',', $ids ), 'bulk-toplevel_page_formidable' ) ) . '">',
'</a>'
);

return $message;
}

public static function destroy() {
Expand Down Expand Up @@ -1808,11 +1807,10 @@ private static function get_advanced_shortcodes() {
'title' => __( 'Do not automatically add any paragraphs or line breaks', 'formidable' ),
),
);
$adv_shortcodes = apply_filters( 'frm_advanced_shortcodes', $adv_shortcodes );

// __( 'Leave blank instead of defaulting to User Login', 'formidable' ) : blank=1

return $adv_shortcodes;
return apply_filters( 'frm_advanced_shortcodes', $adv_shortcodes );
}

/**
Expand Down Expand Up @@ -1957,9 +1955,8 @@ public static function filter_content( $content, $form, $entry = false ) {
}

$shortcodes = FrmFieldsHelper::get_shortcodes( $content, $form );
$content = apply_filters( 'frm_replace_content_shortcodes', $content, $entry, $shortcodes );

return $content;
return apply_filters( 'frm_replace_content_shortcodes', $content, $entry, $shortcodes );
}

/**
Expand Down
3 changes: 1 addition & 2 deletions classes/controllers/FrmSMTPController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ public static function load_hooks() {
*/
public function link( $link ) {
$new_link = 'formidableforms.com/go-wp-mail-smtp/?urllink=wpmailsmtp%2Ecom%2Flite%2Dupgrade&';
$link = str_replace( 'wpmailsmtp.com/lite-upgrade/?', $new_link, $link );
return $link;
return str_replace( 'wpmailsmtp.com/lite-upgrade/?', $new_link, $link );
}

/**
Expand Down
15 changes: 6 additions & 9 deletions classes/controllers/FrmStylesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -474,9 +474,8 @@ function ( $classes ) {
* @return WP_Post
*/
private static function get_default_style() {
$frm_style = new FrmStyle( 'default' );
$default_style = $frm_style->get_one();
return $default_style;
$frm_style = new FrmStyle( 'default' );
return $frm_style->get_one();
}

/**
Expand Down Expand Up @@ -888,11 +887,10 @@ public static function get_custom_css( $single_style_settings = null ) {
}

// If it does not exist, check the default style as a fallback.
$frm_style = new FrmStyle();
$style = $frm_style->get_default_style();
$custom_css = $style->post_content['custom_css'];
$frm_style = new FrmStyle();
$style = $frm_style->get_default_style();

return $custom_css;
return $style->post_content['custom_css'];
}

/**
Expand Down Expand Up @@ -1215,9 +1213,8 @@ public static function enqueue_style() {
*/
public static function get_style_opts() {
$frm_style = new FrmStyle();
$styles = $frm_style->get_all();

return $styles;
return $frm_style->get_all();
}

/**
Expand Down
7 changes: 2 additions & 5 deletions classes/controllers/FrmXMLController.php
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,7 @@ private static function get_posted_form() {
if ( empty( $form ) ) {
return $form;
}

$form = json_decode( $form, true );
return $form;
return json_decode( $form, true );
}

/**
Expand Down Expand Up @@ -607,9 +605,8 @@ public static function get_parent_terms_slugs( $terms ) {
}

$results = FrmDb::get_results( 'terms', array( 'term_id' => $parent_term_ids ), 'term_id, slug' );
$parent_slugs = wp_list_pluck( $results, 'slug', 'term_id' );

return $parent_slugs;
return wp_list_pluck( $results, 'slug', 'term_id' );
}

/**
Expand Down
7 changes: 3 additions & 4 deletions classes/helpers/FrmAppHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -3302,11 +3302,10 @@ public static function human_time_diff( $from, $to = '', $levels = 1 ) {
}
}

$levels_deep = apply_filters( 'frm_time_ago_levels', $levels, compact( 'time_strings', 'from', 'to' ) );
$time_strings = array_slice( $time_strings, 0, absint( $levels_deep ) );
$time_ago_string = implode( ' ', $time_strings );
$levels_deep = apply_filters( 'frm_time_ago_levels', $levels, compact( 'time_strings', 'from', 'to' ) );
$time_strings = array_slice( $time_strings, 0, absint( $levels_deep ) );

return $time_ago_string;
return implode( ' ', $time_strings );
}

/**
Expand Down
12 changes: 3 additions & 9 deletions classes/helpers/FrmCSVExportHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,7 @@ public static function csv_format_options() {
array_splice( $formats, 1, 0, 'UTF-8 with BOM' );
}

$formats = apply_filters( 'frm_csv_format_options', $formats );

return $formats;
return apply_filters( 'frm_csv_format_options', $formats );
}

/**
Expand Down Expand Up @@ -362,16 +360,14 @@ private static function field_headings( $col ) {
$field_headings[ $col->id ] = strip_tags( $col->name );
}

$field_headings = apply_filters(
return apply_filters(
'frm_csv_field_columns',
$field_headings,
array_merge(
self::get_standard_filter_args(),
array( 'field' => $col )
)
);

return $field_headings;
}

/**
Expand Down Expand Up @@ -889,8 +885,6 @@ public static function escape_csv( $value ) {
$value = "'" . $value;
}

$value = str_replace( '"', '""', $value );

return $value;
return str_replace( '"', '""', $value );
}
}
4 changes: 1 addition & 3 deletions classes/helpers/FrmEntriesHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -953,9 +953,7 @@ public static function get_entry_statuses() {
$extended_entry_status = array();
}

$existing_entry_statuses = array_replace( $default_entry_statuses, $extended_entry_status );

return $existing_entry_statuses;
return array_replace( $default_entry_statuses, $extended_entry_status );
}

/**
Expand Down
36 changes: 10 additions & 26 deletions classes/helpers/FrmFieldsHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,7 @@ public static function default_invalid_msg() {
public static function default_unique_msg() {
$frm_settings = FrmAppHelper::get_settings();
$unique_message = $frm_settings->unique_msg;
$unique_message = str_replace( 'This value', '[field_name]', $unique_message );
return $unique_message;
return str_replace( 'This value', '[field_name]', $unique_message );
}

/**
Expand All @@ -328,8 +327,7 @@ public static function default_unique_msg() {
public static function default_blank_msg() {
$frm_settings = FrmAppHelper::get_settings();
$blank_message = $frm_settings->blank_msg;
$blank_message = str_replace( 'This field', '[field_name]', $blank_message );
return $blank_message;
return str_replace( 'This field', '[field_name]', $blank_message );
}

/**
Expand Down Expand Up @@ -376,9 +374,8 @@ public static function get_default_field_options_from_field( $field, $values = a
$opts = $field_type->get_default_field_options();

$opts = apply_filters( 'frm_default_field_opts', $opts, $values, $field );
$opts = apply_filters( 'frm_default_' . $field->type . '_field_opts', $opts, $values, $field );

return $opts;
return apply_filters( 'frm_default_' . $field->type . '_field_opts', $opts, $values, $field );
}

/**
Expand Down Expand Up @@ -483,9 +480,7 @@ public static function get_error_msg( $field, $error ) {
$msg = empty( $msg ) ? $defaults[ $error ]['part'] : $msg;
$msg = do_shortcode( $msg );

$msg = self::maybe_replace_substrings_with_field_name( $msg, $error, $field );

return $msg;
return self::maybe_replace_substrings_with_field_name( $msg, $error, $field );
}

/**
Expand All @@ -510,9 +505,7 @@ private static function maybe_replace_substrings_with_field_name( $msg, $error,
$field_name = __( 'This field', 'formidable' );
}
}

$msg = str_replace( $substrings, $field_name, $msg );
return $msg;
return str_replace( $substrings, $field_name, $msg );
}

/**
Expand Down Expand Up @@ -1031,9 +1024,8 @@ public static function basic_replace_shortcodes( $value, $form, $entry ) {
}

$value = apply_filters( 'frm_content', $value, $form, $entry );
$value = do_shortcode( $value );

return $value;
return do_shortcode( $value );
}

/**
Expand Down Expand Up @@ -1090,9 +1082,7 @@ public static function allowed_shortcodes( $fields = array() ) {
$tagregexp[] = $field->field_key;
}

$tagregexp = implode( '|', $tagregexp );

return $tagregexp;
return implode( '|', $tagregexp );
}

/**
Expand Down Expand Up @@ -1475,9 +1465,7 @@ public static function get_field_types( $type ) {
$field_types[ $type ] = $field_selection[ $type ];
}

$field_types = apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );

return $field_types;
return apply_filters( 'frm_switch_field_types', $field_types, compact( 'type', 'field_selection' ) );
}

/**
Expand Down Expand Up @@ -1794,9 +1782,7 @@ public static function get_other_field_html_id( $type, $html_id, $opt_key = fals
$other_id .= '-' . $opt_key;
}

$other_id .= '-otext';

return $other_id;
return $other_id . '-otext';
}

/**
Expand Down Expand Up @@ -1879,9 +1865,7 @@ private static function switch_ids_except_strings( $replace, $replace_with, $exc
unset( $replace[ $index ] );
unset( $replace_with[ $index ] );
}

$value = str_replace( $replace, $replace_with, $value );
return $value;
return str_replace( $replace, $replace_with, $value );
}

/**
Expand Down
Loading