@@ -152,13 +152,13 @@ discard block |
||
| 152 | 152 | |
| 153 | 153 | $is_setup_intent = 0 === strpos( $intent->id, 'seti_' ); |
| 154 | 154 | if ( $is_setup_intent ) { |
| 155 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
| 155 | + $errors['field' . $cc_field_id] = is_object( $intent->last_setup_error ) ? $intent->last_setup_error->message : ''; |
|
| 156 | 156 | } else { |
| 157 | - $errors[ 'field' . $cc_field_id ] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
| 157 | + $errors['field' . $cc_field_id] = is_object( $intent->last_payment_error ) ? $intent->last_payment_error->message : ''; |
|
| 158 | 158 | } |
| 159 | 159 | |
| 160 | - if ( ! $errors[ 'field' . $cc_field_id ] ) { |
|
| 161 | - $errors[ 'field' . $cc_field_id ] = 'Payment was not successfully processed.'; |
|
| 160 | + if ( ! $errors['field' . $cc_field_id] ) { |
|
| 161 | + $errors['field' . $cc_field_id] = 'Payment was not successfully processed.'; |
|
| 162 | 162 | } |
| 163 | 163 | |
| 164 | 164 | global $frm_vars; |
@@ -187,10 +187,10 @@ discard block |
||
| 187 | 187 | $save_draft = ! empty( $form->options['save_draft'] ); |
| 188 | 188 | |
| 189 | 189 | global $frm_vars; |
| 190 | - $frm_vars['created_entries'][ $form_id ]['errors'] = $errors; |
|
| 190 | + $frm_vars['created_entries'][$form_id]['errors'] = $errors; |
|
| 191 | 191 | |
| 192 | 192 | // Set to true to get FrmProFieldsHelper::get_page_with_error() run. |
| 193 | - $_POST[ 'frm_page_order_' . $form_id ] = true; |
|
| 193 | + $_POST['frm_page_order_' . $form_id] = true; |
|
| 194 | 194 | |
| 195 | 195 | if ( ! $save_draft ) { |
| 196 | 196 | // If draft saving is not on, delete the entry. |
@@ -199,7 +199,7 @@ discard block |
||
| 199 | 199 | } |
| 200 | 200 | |
| 201 | 201 | // If draft saving is on, load the draft entry. |
| 202 | - $frm_vars['created_entries'][ $form_id ]['entry_id'] = $entry_id; |
|
| 202 | + $frm_vars['created_entries'][$form_id]['entry_id'] = $entry_id; |
|
| 203 | 203 | add_action( |
| 204 | 204 | 'frm_filter_final_form', |
| 205 | 205 | /** |
@@ -210,7 +210,7 @@ discard block |
||
| 210 | 210 | * |
| 211 | 211 | * @return string |
| 212 | 212 | */ |
| 213 | - function ( $html ) use ( $entry_id ) { |
|
| 213 | + function( $html ) use ( $entry_id ) { |
|
| 214 | 214 | global $wpdb; |
| 215 | 215 | $wpdb->update( $wpdb->prefix . 'frm_items', array( 'is_draft' => 1 ), array( 'id' => $entry_id ) ); |
| 216 | 216 | return $html; |
@@ -26,7 +26,7 @@ |
||
| 26 | 26 | * |
| 27 | 27 | * @return void |
| 28 | 28 | */ |
| 29 | - function ( $frm_settings ) { |
|
| 29 | + function( $frm_settings ) { |
|
| 30 | 30 | $stripe_settings = FrmStrpLiteAppHelper::get_settings()->settings; |
| 31 | 31 | require FrmStrpLiteAppHelper::plugin_path() . '/views/settings/messages.php'; |
| 32 | 32 | } |
@@ -500,8 +500,8 @@ discard block |
||
| 500 | 500 | return $values; |
| 501 | 501 | } |
| 502 | 502 | |
| 503 | - if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[ $field->id ] ) ) { |
|
| 504 | - $values['value'] = $previous_entry->metas[ $field->id ]; |
|
| 503 | + if ( is_array( $previous_entry->metas ) && isset( $previous_entry->metas[$field->id] ) ) { |
|
| 504 | + $values['value'] = $previous_entry->metas[$field->id]; |
|
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | $frm_vars['trans_filled'] = true; |
@@ -538,7 +538,7 @@ discard block |
||
| 538 | 538 | * |
| 539 | 539 | * @return void |
| 540 | 540 | */ |
| 541 | - function () use ( $entry_id, &$destroy_callback ) { |
|
| 541 | + function() use ( $entry_id, &$destroy_callback ) { |
|
| 542 | 542 | FrmEntry::destroy( $entry_id ); |
| 543 | 543 | // Only call this once. |
| 544 | 544 | remove_action( 'frm_entry_form', $destroy_callback ); |
@@ -559,7 +559,7 @@ discard block |
||
| 559 | 559 | * @return array |
| 560 | 560 | */ |
| 561 | 561 | public static function before_save_settings( $settings, $action ) { |
| 562 | - $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
| 562 | + $settings['gateway'] = ! empty( $settings['gateway'] ) ? (array) $settings['gateway'] : array( 'stripe' ); |
|
| 563 | 563 | |
| 564 | 564 | if ( in_array( 'square', $settings['gateway'] ) ) { |
| 565 | 565 | $currency = FrmSquareLiteConnectHelper::get_merchant_currency(); |
@@ -768,7 +768,7 @@ discard block |
||
| 768 | 768 | * |
| 769 | 769 | * @return string |
| 770 | 770 | */ |
| 771 | - function ( $src ) { |
|
| 771 | + function( $src ) { |
|
| 772 | 772 | if ( is_null( $src ) ) { |
| 773 | 773 | $src = ''; |
| 774 | 774 | } |
@@ -834,11 +834,11 @@ discard block |
||
| 834 | 834 | ), |
| 835 | 835 | ); |
| 836 | 836 | |
| 837 | - if ( ! isset( $available_status[ $status ] ) ) { |
|
| 837 | + if ( ! isset( $available_status[$status] ) ) { |
|
| 838 | 838 | return; |
| 839 | 839 | } |
| 840 | 840 | |
| 841 | - FrmAppHelper::permission_check( $available_status[ $status ]['permission'] ); |
|
| 841 | + FrmAppHelper::permission_check( $available_status[$status]['permission'] ); |
|
| 842 | 842 | |
| 843 | 843 | $params = FrmForm::list_page_params(); |
| 844 | 844 | |
@@ -846,8 +846,8 @@ discard block |
||
| 846 | 846 | check_admin_referer( $status . '_form_' . $params['id'] ); |
| 847 | 847 | |
| 848 | 848 | $count = 0; |
| 849 | - if ( FrmForm::set_status( $params['id'], $available_status[ $status ]['new_status'] ) ) { |
|
| 850 | - ++$count; |
|
| 849 | + if ( FrmForm::set_status( $params['id'], $available_status[$status]['new_status'] ) ) { |
|
| 850 | + ++ $count; |
|
| 851 | 851 | } |
| 852 | 852 | |
| 853 | 853 | $form_type = FrmAppHelper::get_simple_request( |
@@ -863,7 +863,7 @@ discard block |
||
| 863 | 863 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 864 | 864 | $available_status['trash']['message'] = sprintf( _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=untrash&form_type=' . $form_type . '&id=' . $params['id'], 'untrash_form_' . $params['id'] ) ) . '">', '</a>' ); |
| 865 | 865 | |
| 866 | - $message = $available_status[ $status ]['message']; |
|
| 866 | + $message = $available_status[$status]['message']; |
|
| 867 | 867 | |
| 868 | 868 | self::display_forms_list( $params, $message ); |
| 869 | 869 | } |
@@ -879,7 +879,7 @@ discard block |
||
| 879 | 879 | $count = 0; |
| 880 | 880 | foreach ( $ids as $id ) { |
| 881 | 881 | if ( FrmForm::trash( $id ) ) { |
| 882 | - ++$count; |
|
| 882 | + ++ $count; |
|
| 883 | 883 | } |
| 884 | 884 | } |
| 885 | 885 | |
@@ -893,7 +893,7 @@ discard block |
||
| 893 | 893 | 'type' => 'request', |
| 894 | 894 | ) |
| 895 | 895 | ); |
| 896 | - $message = sprintf( |
|
| 896 | + $message = sprintf( |
|
| 897 | 897 | /* translators: %1$s: Number of forms, %2$s: Start link HTML, %3$s: End link HTML */ |
| 898 | 898 | _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' ), |
| 899 | 899 | $count, |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | |
| 915 | 915 | $count = 0; |
| 916 | 916 | if ( FrmForm::destroy( $params['id'] ) ) { |
| 917 | - ++$count; |
|
| 917 | + ++ $count; |
|
| 918 | 918 | } |
| 919 | 919 | |
| 920 | 920 | /* translators: %1$s: Number of forms */ |
@@ -935,7 +935,7 @@ discard block |
||
| 935 | 935 | foreach ( $ids as $id ) { |
| 936 | 936 | $d = FrmForm::destroy( $id ); |
| 937 | 937 | if ( $d ) { |
| 938 | - ++$count; |
|
| 938 | + ++ $count; |
|
| 939 | 939 | } |
| 940 | 940 | } |
| 941 | 941 | |
@@ -1454,7 +1454,7 @@ discard block |
||
| 1454 | 1454 | |
| 1455 | 1455 | add_action( |
| 1456 | 1456 | 'wp_enqueue_editor', |
| 1457 | - function () { |
|
| 1457 | + function() { |
|
| 1458 | 1458 | wp_print_media_templates(); |
| 1459 | 1459 | } |
| 1460 | 1460 | ); |
@@ -1590,7 +1590,7 @@ discard block |
||
| 1590 | 1590 | $section['id'] = $section['anchor']; |
| 1591 | 1591 | } |
| 1592 | 1592 | |
| 1593 | - $sections[ $key ] = $section; |
|
| 1593 | + $sections[$key] = $section; |
|
| 1594 | 1594 | }//end foreach |
| 1595 | 1595 | |
| 1596 | 1596 | return $sections; |
@@ -1723,7 +1723,7 @@ discard block |
||
| 1723 | 1723 | if ( $user_fields ) { |
| 1724 | 1724 | $user_helpers = array(); |
| 1725 | 1725 | foreach ( $user_fields as $uk => $uf ) { |
| 1726 | - $user_helpers[ '|user_id| show="' . $uk . '"' ] = $uf; |
|
| 1726 | + $user_helpers['|user_id| show="' . $uk . '"'] = $uf; |
|
| 1727 | 1727 | unset( $uk, $uf ); |
| 1728 | 1728 | } |
| 1729 | 1729 | |
@@ -1869,7 +1869,7 @@ discard block |
||
| 1869 | 1869 | if ( ! isset( $frm_vars['js_validate_forms'] ) ) { |
| 1870 | 1870 | $frm_vars['js_validate_forms'] = array(); |
| 1871 | 1871 | } |
| 1872 | - $frm_vars['js_validate_forms'][ $form->id ] = $form; |
|
| 1872 | + $frm_vars['js_validate_forms'][$form->id] = $form; |
|
| 1873 | 1873 | } |
| 1874 | 1874 | |
| 1875 | 1875 | public static function get_email_html() { |
@@ -2065,7 +2065,7 @@ discard block |
||
| 2065 | 2065 | add_filter( 'frm_validate_form', 'FrmFormsController::json_error' ); |
| 2066 | 2066 | } else { |
| 2067 | 2067 | $vars = FrmAppHelper::json_to_array( $json_vars ); |
| 2068 | - $action = $vars[ $action ]; |
|
| 2068 | + $action = $vars[$action]; |
|
| 2069 | 2069 | unset( $_REQUEST['frm_compact_fields'], $_POST['frm_compact_fields'] ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 2070 | 2070 | $_REQUEST = array_merge( $_REQUEST, $vars ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
| 2071 | 2071 | $_POST = array_merge( $_POST, $_REQUEST ); // phpcs:ignore WordPress.Security.NonceVerification.Missing |
@@ -2257,7 +2257,7 @@ discard block |
||
| 2257 | 2257 | $actions = array(); |
| 2258 | 2258 | foreach ( $frm_vars['forms_loaded'] as $form ) { |
| 2259 | 2259 | if ( is_object( $form ) ) { |
| 2260 | - $actions[ $form->id ] = $form->name; |
|
| 2260 | + $actions[$form->id] = $form->name; |
|
| 2261 | 2261 | } |
| 2262 | 2262 | unset( $form ); |
| 2263 | 2263 | } |
@@ -2541,8 +2541,8 @@ discard block |
||
| 2541 | 2541 | private static function get_saved_errors( $form, $params ) { |
| 2542 | 2542 | global $frm_vars; |
| 2543 | 2543 | |
| 2544 | - if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][ $form->id ] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2545 | - $errors = $frm_vars['created_entries'][ $form->id ]['errors']; |
|
| 2544 | + if ( $params['posted_form_id'] == $form->id && $_POST && isset( $frm_vars['created_entries'][$form->id] ) ) { // phpcs:ignore WordPress.Security.NonceVerification.Missing |
|
| 2545 | + $errors = $frm_vars['created_entries'][$form->id]['errors']; |
|
| 2546 | 2546 | } else { |
| 2547 | 2547 | $errors = array(); |
| 2548 | 2548 | } |
@@ -2568,7 +2568,7 @@ discard block |
||
| 2568 | 2568 | public static function just_created_entry( $form_id ) { |
| 2569 | 2569 | global $frm_vars; |
| 2570 | 2570 | |
| 2571 | - return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][ $form_id ] ) && isset( $frm_vars['created_entries'][ $form_id ]['entry_id'] ) ? $frm_vars['created_entries'][ $form_id ]['entry_id'] : 0; |
|
| 2571 | + return isset( $frm_vars['created_entries'] ) && isset( $frm_vars['created_entries'][$form_id] ) && isset( $frm_vars['created_entries'][$form_id]['entry_id'] ) ? $frm_vars['created_entries'][$form_id]['entry_id'] : 0; |
|
| 2572 | 2572 | } |
| 2573 | 2573 | |
| 2574 | 2574 | /** |
@@ -2589,7 +2589,7 @@ discard block |
||
| 2589 | 2589 | private static function get_confirmation_method( $atts ) { |
| 2590 | 2590 | $action = FrmOnSubmitHelper::current_event( $atts ); |
| 2591 | 2591 | $opt = 'update' === $action ? 'edit_action' : 'success_action'; |
| 2592 | - $method = ! empty( $atts['form']->options[ $opt ] ) ? $atts['form']->options[ $opt ] : 'message'; |
|
| 2592 | + $method = ! empty( $atts['form']->options[$opt] ) ? $atts['form']->options[$opt] : 'message'; |
|
| 2593 | 2593 | |
| 2594 | 2594 | if ( ! empty( $atts['entry_id'] ) ) { |
| 2595 | 2595 | $met_actions = self::get_met_on_submit_actions( $atts, $action ); |
@@ -2617,7 +2617,7 @@ discard block |
||
| 2617 | 2617 | public static function maybe_trigger_redirect( $form, $params, $args ) { |
| 2618 | 2618 | if ( ! isset( $params['id'] ) ) { |
| 2619 | 2619 | global $frm_vars; |
| 2620 | - $params['id'] = $frm_vars['created_entries'][ $form->id ]['entry_id']; |
|
| 2620 | + $params['id'] = $frm_vars['created_entries'][$form->id]['entry_id']; |
|
| 2621 | 2621 | } |
| 2622 | 2622 | |
| 2623 | 2623 | $conf_method = self::get_confirmation_method( |
@@ -2706,7 +2706,7 @@ discard block |
||
| 2706 | 2706 | $args['success_opt'] = $opt; |
| 2707 | 2707 | $args['ajax'] = ! empty( $frm_vars['ajax'] ); |
| 2708 | 2708 | |
| 2709 | - if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[ $opt . '_page_id' ] ) ) { |
|
| 2709 | + if ( $args['conf_method'] === 'page' && is_numeric( $args['form']->options[$opt . '_page_id'] ) ) { |
|
| 2710 | 2710 | self::load_page_after_submit( $args ); |
| 2711 | 2711 | } elseif ( $args['conf_method'] === 'redirect' ) { |
| 2712 | 2712 | self::redirect_after_submit( $args ); |
@@ -2731,7 +2731,7 @@ discard block |
||
| 2731 | 2731 | } |
| 2732 | 2732 | |
| 2733 | 2733 | // If a redirect action has already opened the URL in a new tab, we show the default message in the current tab. |
| 2734 | - if ( ! empty( self::$redirected_in_new_tab[ $args['form']->id ] ) ) { |
|
| 2734 | + if ( ! empty( self::$redirected_in_new_tab[$args['form']->id] ) ) { |
|
| 2735 | 2735 | return array( FrmOnSubmitHelper::get_fallback_action_after_open_in_new_tab( $event ) ); |
| 2736 | 2736 | } |
| 2737 | 2737 | |
@@ -2921,7 +2921,7 @@ discard block |
||
| 2921 | 2921 | |
| 2922 | 2922 | $opt = 'update' === $args['action'] ? 'edit_' : 'success_'; |
| 2923 | 2923 | |
| 2924 | - $new_args['conf_method'] = $new_args['form']->options[ $opt . 'action' ]; |
|
| 2924 | + $new_args['conf_method'] = $new_args['form']->options[$opt . 'action']; |
|
| 2925 | 2925 | |
| 2926 | 2926 | /** |
| 2927 | 2927 | * Filters the run success action args. |
@@ -2945,8 +2945,8 @@ discard block |
||
| 2945 | 2945 | private static function load_page_after_submit( $args ) { |
| 2946 | 2946 | global $post; |
| 2947 | 2947 | $opt = $args['success_opt']; |
| 2948 | - if ( ! $post || $args['form']->options[ $opt . '_page_id' ] != $post->ID ) { |
|
| 2949 | - $page = get_post( $args['form']->options[ $opt . '_page_id' ] ); |
|
| 2948 | + if ( ! $post || $args['form']->options[$opt . '_page_id'] != $post->ID ) { |
|
| 2949 | + $page = get_post( $args['form']->options[$opt . '_page_id'] ); |
|
| 2950 | 2950 | $old_post = $post; |
| 2951 | 2951 | $post = $page; |
| 2952 | 2952 | $content = apply_filters( 'frm_content', $page->post_content, $args['form'], $args['entry_id'] ); |
@@ -2977,7 +2977,7 @@ discard block |
||
| 2977 | 2977 | add_filter( 'frm_use_wpautop', '__return_false' ); |
| 2978 | 2978 | |
| 2979 | 2979 | $opt = $args['success_opt']; |
| 2980 | - $success_url = trim( $args['form']->options[ $opt . '_url' ] ); |
|
| 2980 | + $success_url = trim( $args['form']->options[$opt . '_url'] ); |
|
| 2981 | 2981 | $success_url = apply_filters( 'frm_content', $success_url, $args['form'], $args['entry_id'] ); |
| 2982 | 2982 | $success_url = do_shortcode( $success_url ); |
| 2983 | 2983 | |
@@ -2999,7 +2999,7 @@ discard block |
||
| 2999 | 2999 | // Not AJAX submit, no headers sent, and there is just one Redirect action runs. |
| 3000 | 3000 | if ( ! empty( $args['form']->options['open_in_new_tab'] ) ) { |
| 3001 | 3001 | self::print_open_in_new_tab_js_with_fallback_handler( $success_url, $args ); |
| 3002 | - self::$redirected_in_new_tab[ $args['form']->id ] = 1; |
|
| 3002 | + self::$redirected_in_new_tab[$args['form']->id] = 1; |
|
| 3003 | 3003 | return; |
| 3004 | 3004 | } |
| 3005 | 3005 | |
@@ -3304,7 +3304,7 @@ discard block |
||
| 3304 | 3304 | 'description' => false, |
| 3305 | 3305 | 'reset' => false, |
| 3306 | 3306 | ); |
| 3307 | - $args = wp_parse_args( $args, $defaults ); |
|
| 3307 | + $args = wp_parse_args( $args, $defaults ); |
|
| 3308 | 3308 | } |
| 3309 | 3309 | |
| 3310 | 3310 | /** |
@@ -3347,7 +3347,7 @@ discard block |
||
| 3347 | 3347 | $opt = $args['success_opt'] ?? 'success'; |
| 3348 | 3348 | |
| 3349 | 3349 | if ( $entry_id && is_numeric( $entry_id ) ) { |
| 3350 | - $message = $form->options[ $opt . '_msg' ] ?? $frm_settings->success_msg; |
|
| 3350 | + $message = $form->options[$opt . '_msg'] ?? $frm_settings->success_msg; |
|
| 3351 | 3351 | $class = 'frm_message'; |
| 3352 | 3352 | } else { |
| 3353 | 3353 | $message = $frm_settings->failed_msg; |
@@ -3599,8 +3599,8 @@ discard block |
||
| 3599 | 3599 | |
| 3600 | 3600 | check_ajax_referer( 'frm_ajax', 'nonce' ); |
| 3601 | 3601 | |
| 3602 | - $html = FrmAppHelper::clip( |
|
| 3603 | - function () { |
|
| 3602 | + $html = FrmAppHelper::clip( |
|
| 3603 | + function() { |
|
| 3604 | 3604 | FrmAppHelper::maybe_autocomplete_pages_options( |
| 3605 | 3605 | array( |
| 3606 | 3606 | 'field_name' => 'frm_page_dropdown', |
@@ -54,7 +54,7 @@ |
||
| 54 | 54 | * |
| 55 | 55 | * @return void |
| 56 | 56 | */ |
| 57 | - function ( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
| 57 | + function( $form ) use ( $styles, $default_style, $row_view_file_path ) { |
|
| 58 | 58 | $active_style_id = isset( $form->options['custom_style'] ) ? (int) $form->options['custom_style'] : 1; |
| 59 | 59 | if ( 1 === $active_style_id ) { |
| 60 | 60 | // use the default style |
@@ -113,7 +113,7 @@ discard block |
||
| 113 | 113 | return; |
| 114 | 114 | } |
| 115 | 115 | |
| 116 | - if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) { |
|
| 116 | + if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) { |
|
| 117 | 117 | // Don't replace messages unless required. |
| 118 | 118 | return; |
| 119 | 119 | } |
@@ -122,13 +122,13 @@ discard block |
||
| 122 | 122 | return; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | - if ( isset( self::$messages[ $message['key'] ] ) ) { |
|
| 125 | + if ( isset( self::$messages[$message['key']] ) ) { |
|
| 126 | 126 | // Move up and mark as new. |
| 127 | - unset( self::$messages[ $message['key'] ] ); |
|
| 127 | + unset( self::$messages[$message['key']] ); |
|
| 128 | 128 | } |
| 129 | 129 | |
| 130 | 130 | $this->fill_message( $message ); |
| 131 | - self::$messages[ $message['key'] ] = $message; |
|
| 131 | + self::$messages[$message['key']] = $message; |
|
| 132 | 132 | |
| 133 | 133 | $this->update_list(); |
| 134 | 134 | |
@@ -165,11 +165,11 @@ discard block |
||
| 165 | 165 | private function clean_messages() { |
| 166 | 166 | $removed = false; |
| 167 | 167 | foreach ( self::$messages as $t => $message ) { |
| 168 | - $read = ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' ); |
|
| 169 | - $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' ); |
|
| 168 | + $read = ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' ); |
|
| 169 | + $dismissed = ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' ); |
|
| 170 | 170 | |
| 171 | 171 | if ( $read || $dismissed || ! $this->within_valid_timeframe( $message ) ) { |
| 172 | - unset( self::$messages[ $t ] ); |
|
| 172 | + unset( self::$messages[$t] ); |
|
| 173 | 173 | $removed = true; |
| 174 | 174 | } |
| 175 | 175 | } |
@@ -188,11 +188,11 @@ discard block |
||
| 188 | 188 | public function filter_messages( &$messages, $type = 'unread' ) { |
| 189 | 189 | $user_id = get_current_user_id(); |
| 190 | 190 | foreach ( $messages as $k => $message ) { |
| 191 | - $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] ); |
|
| 191 | + $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] ); |
|
| 192 | 192 | if ( empty( $k ) || ! $this->within_valid_timeframe( $message ) || ( $type === 'dismissed' ) !== $dismissed ) { |
| 193 | - unset( $messages[ $k ] ); |
|
| 193 | + unset( $messages[$k] ); |
|
| 194 | 194 | } elseif ( ! $this->is_for_user( $message ) ) { |
| 195 | - unset( $messages[ $k ] ); |
|
| 195 | + unset( $messages[$k] ); |
|
| 196 | 196 | } |
| 197 | 197 | } |
| 198 | 198 | $messages = apply_filters( 'frm_filter_inbox', $messages ); |
@@ -269,14 +269,14 @@ discard block |
||
| 269 | 269 | * @return void |
| 270 | 270 | */ |
| 271 | 271 | public function mark_read( $key ) { |
| 272 | - if ( ! $key || ! isset( self::$messages[ $key ] ) ) { |
|
| 272 | + if ( ! $key || ! isset( self::$messages[$key] ) ) { |
|
| 273 | 273 | return; |
| 274 | 274 | } |
| 275 | 275 | |
| 276 | - if ( ! isset( self::$messages[ $key ]['read'] ) ) { |
|
| 277 | - self::$messages[ $key ]['read'] = array(); |
|
| 276 | + if ( ! isset( self::$messages[$key]['read'] ) ) { |
|
| 277 | + self::$messages[$key]['read'] = array(); |
|
| 278 | 278 | } |
| 279 | - self::$messages[ $key ]['read'][ get_current_user_id() ] = time(); |
|
| 279 | + self::$messages[$key]['read'][get_current_user_id()] = time(); |
|
| 280 | 280 | |
| 281 | 281 | $this->update_list(); |
| 282 | 282 | } |
@@ -289,9 +289,9 @@ discard block |
||
| 289 | 289 | * @return void |
| 290 | 290 | */ |
| 291 | 291 | public function mark_unread( $key ) { |
| 292 | - $is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 292 | + $is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
| 293 | 293 | if ( $is_read ) { |
| 294 | - unset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 294 | + unset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
| 295 | 295 | $this->update_list(); |
| 296 | 296 | } |
| 297 | 297 | } |
@@ -307,14 +307,14 @@ discard block |
||
| 307 | 307 | return; |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - if ( ! isset( self::$messages[ $key ] ) ) { |
|
| 310 | + if ( ! isset( self::$messages[$key] ) ) { |
|
| 311 | 311 | return; |
| 312 | 312 | } |
| 313 | 313 | |
| 314 | - if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) { |
|
| 315 | - self::$messages[ $key ]['dismissed'] = array(); |
|
| 314 | + if ( ! isset( self::$messages[$key]['dismissed'] ) ) { |
|
| 315 | + self::$messages[$key]['dismissed'] = array(); |
|
| 316 | 316 | } |
| 317 | - self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time(); |
|
| 317 | + self::$messages[$key]['dismissed'][get_current_user_id()] = time(); |
|
| 318 | 318 | |
| 319 | 319 | $this->update_list(); |
| 320 | 320 | } |
@@ -328,11 +328,11 @@ discard block |
||
| 328 | 328 | $user_id = get_current_user_id(); |
| 329 | 329 | foreach ( self::$messages as $key => $message ) { |
| 330 | 330 | if ( ! isset( $message['dismissed'] ) ) { |
| 331 | - self::$messages[ $key ]['dismissed'] = array(); |
|
| 331 | + self::$messages[$key]['dismissed'] = array(); |
|
| 332 | 332 | } |
| 333 | 333 | |
| 334 | - if ( ! isset( $message['dismissed'][ $user_id ] ) ) { |
|
| 335 | - self::$messages[ $key ]['dismissed'][ $user_id ] = time(); |
|
| 334 | + if ( ! isset( $message['dismissed'][$user_id] ) ) { |
|
| 335 | + self::$messages[$key]['dismissed'][$user_id] = time(); |
|
| 336 | 336 | } |
| 337 | 337 | } |
| 338 | 338 | $this->update_list(); |
@@ -345,8 +345,8 @@ discard block |
||
| 345 | 345 | $messages = $this->get_messages( 'filter' ); |
| 346 | 346 | $user_id = get_current_user_id(); |
| 347 | 347 | foreach ( $messages as $t => $message ) { |
| 348 | - if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) { |
|
| 349 | - unset( $messages[ $t ] ); |
|
| 348 | + if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) { |
|
| 349 | + unset( $messages[$t] ); |
|
| 350 | 350 | } |
| 351 | 351 | } |
| 352 | 352 | return $messages; |
@@ -387,8 +387,8 @@ discard block |
||
| 387 | 387 | * @return void |
| 388 | 388 | */ |
| 389 | 389 | public function remove( $key ) { |
| 390 | - if ( isset( self::$messages[ $key ] ) ) { |
|
| 391 | - unset( self::$messages[ $key ] ); |
|
| 390 | + if ( isset( self::$messages[$key] ) ) { |
|
| 391 | + unset( self::$messages[$key] ); |
|
| 392 | 392 | $this->update_list(); |
| 393 | 393 | } |
| 394 | 394 | } |
@@ -436,7 +436,7 @@ discard block |
||
| 436 | 436 | * |
| 437 | 437 | * @return string |
| 438 | 438 | */ |
| 439 | - function ( $matches ) { |
|
| 439 | + function( $matches ) { |
|
| 440 | 440 | $url = $matches[2]; |
| 441 | 441 | $parts = parse_url( $url ); |
| 442 | 442 | |
@@ -500,8 +500,8 @@ discard block |
||
| 500 | 500 | $inbox = new self(); |
| 501 | 501 | return array_filter( |
| 502 | 502 | $inbox->get_messages( 'filter' ), |
| 503 | - function ( $message ) use ( $key ) { |
|
| 504 | - return ! empty( $message[ $key ] ); |
|
| 503 | + function( $message ) use ( $key ) { |
|
| 504 | + return ! empty( $message[$key] ); |
|
| 505 | 505 | } |
| 506 | 506 | ); |
| 507 | 507 | } |
@@ -547,8 +547,8 @@ discard block |
||
| 547 | 547 | |
| 548 | 548 | return array_reduce( |
| 549 | 549 | $keys_to_return, |
| 550 | - function ( $total, $key ) use ( $message ) { |
|
| 551 | - $total[ $key ] = $message[ $key ] ?? ''; |
|
| 550 | + function( $total, $key ) use ( $message ) { |
|
| 551 | + $total[$key] = $message[$key] ?? ''; |
|
| 552 | 552 | return $total; |
| 553 | 553 | }, |
| 554 | 554 | array() |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | /** |
| 9 | 9 | * @var bool |
| 10 | 10 | */ |
| 11 | - public static $use_cache = true; |
|
| 11 | + public static $use_cache = true; |
|
| 12 | 12 | |
| 13 | 13 | /** |
| 14 | 14 | * @var int |
@@ -281,11 +281,11 @@ discard block |
||
| 281 | 281 | 'ranking' => '2024-03-12', |
| 282 | 282 | ); |
| 283 | 283 | |
| 284 | - if ( ! isset( $release_dates[ $type ] ) ) { |
|
| 284 | + if ( ! isset( $release_dates[$type] ) ) { |
|
| 285 | 285 | return false; |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | - $release_date = $release_dates[ $type ]; |
|
| 288 | + $release_date = $release_dates[$type]; |
|
| 289 | 289 | |
| 290 | 290 | $three_months_after_release = gmdate( 'Y-m-d', strtotime( $release_date . ' + 90 days' ) ); |
| 291 | 291 | return gmdate( 'Y-m-d' ) < $three_months_after_release; |
@@ -319,8 +319,8 @@ discard block |
||
| 319 | 319 | $values = FrmAppHelper::maybe_filter_array( $values, array( 'name', 'description' ) ); |
| 320 | 320 | |
| 321 | 321 | foreach ( array( 'name', 'description', 'type', 'default_value' ) as $col ) { |
| 322 | - if ( isset( $values[ $col ] ) ) { |
|
| 323 | - $new_values[ $col ] = $values[ $col ]; |
|
| 322 | + if ( isset( $values[$col] ) ) { |
|
| 323 | + $new_values[$col] = $values[$col]; |
|
| 324 | 324 | } |
| 325 | 325 | } |
| 326 | 326 | |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | $new_values['created_at'] = current_time( 'mysql', 1 ); |
| 333 | 333 | |
| 334 | 334 | if ( isset( $values['id'] ) ) { |
| 335 | - $frm_duplicate_ids[ $values['field_key'] ] = $new_values['field_key']; |
|
| 335 | + $frm_duplicate_ids[$values['field_key']] = $new_values['field_key']; |
|
| 336 | 336 | $new_values = apply_filters( 'frm_duplicated_field', $new_values ); |
| 337 | 337 | } |
| 338 | 338 | |
@@ -341,9 +341,9 @@ discard block |
||
| 341 | 341 | foreach ( $new_values as $k => $v ) { |
| 342 | 342 | if ( is_array( $v ) ) { |
| 343 | 343 | if ( $k === 'default_value' ) { |
| 344 | - $new_values[ $k ] = FrmAppHelper::maybe_json_encode( $v ); |
|
| 344 | + $new_values[$k] = FrmAppHelper::maybe_json_encode( $v ); |
|
| 345 | 345 | } else { |
| 346 | - $new_values[ $k ] = serialize( $v ); |
|
| 346 | + $new_values[$k] = serialize( $v ); |
|
| 347 | 347 | } |
| 348 | 348 | } |
| 349 | 349 | unset( $k, $v ); |
@@ -363,7 +363,7 @@ discard block |
||
| 363 | 363 | } |
| 364 | 364 | |
| 365 | 365 | if ( isset( $values['id'] ) ) { |
| 366 | - $frm_duplicate_ids[ $values['id'] ] = $new_id; |
|
| 366 | + $frm_duplicate_ids[$values['id']] = $new_id; |
|
| 367 | 367 | } |
| 368 | 368 | |
| 369 | 369 | return $new_id; |
@@ -417,7 +417,7 @@ discard block |
||
| 417 | 417 | * |
| 418 | 418 | * @return string |
| 419 | 419 | */ |
| 420 | - function ( $match ) { |
|
| 420 | + function( $match ) { |
|
| 421 | 421 | $attr = shortcode_parse_atts( $match[3] ); |
| 422 | 422 | |
| 423 | 423 | if ( ! is_array( $attr ) ) { |
@@ -442,7 +442,7 @@ discard block |
||
| 442 | 442 | } |
| 443 | 443 | |
| 444 | 444 | if ( FrmAppHelper::input_key_is_safe( $key, 'update' ) ) { |
| 445 | - $safe_atts[ $key ] = $value; |
|
| 445 | + $safe_atts[$key] = $value; |
|
| 446 | 446 | } |
| 447 | 447 | } |
| 448 | 448 | |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | public static function duplicate( $old_form_id, $form_id, $copy_keys = false, $blog_id = false ) { |
| 514 | 514 | global $frm_duplicate_ids; |
| 515 | 515 | |
| 516 | - $where = array( |
|
| 516 | + $where = array( |
|
| 517 | 517 | array( |
| 518 | 518 | 'or' => 1, |
| 519 | 519 | 'fi.form_id' => $old_form_id, |
@@ -559,8 +559,8 @@ discard block |
||
| 559 | 559 | |
| 560 | 560 | $values = apply_filters( 'frm_duplicated_field', $values ); |
| 561 | 561 | $new_id = self::create( $values ); |
| 562 | - $frm_duplicate_ids[ $field->id ] = $new_id; |
|
| 563 | - $frm_duplicate_ids[ $field->field_key ] = $new_id; |
|
| 562 | + $frm_duplicate_ids[$field->id] = $new_id; |
|
| 563 | + $frm_duplicate_ids[$field->field_key] = $new_id; |
|
| 564 | 564 | unset( $field ); |
| 565 | 565 | }//end foreach |
| 566 | 566 | } |
@@ -610,11 +610,11 @@ discard block |
||
| 610 | 610 | |
| 611 | 611 | // serialize array values |
| 612 | 612 | foreach ( array( 'field_options', 'options' ) as $opt ) { |
| 613 | - if ( isset( $values[ $opt ] ) && is_array( $values[ $opt ] ) ) { |
|
| 613 | + if ( isset( $values[$opt] ) && is_array( $values[$opt] ) ) { |
|
| 614 | 614 | if ( 'field_options' === $opt ) { |
| 615 | - $values[ $opt ] = self::maybe_filter_options( $values[ $opt ] ); |
|
| 615 | + $values[$opt] = self::maybe_filter_options( $values[$opt] ); |
|
| 616 | 616 | } |
| 617 | - $values[ $opt ] = serialize( $values[ $opt ] ); |
|
| 617 | + $values[$opt] = serialize( $values[$opt] ); |
|
| 618 | 618 | } |
| 619 | 619 | } |
| 620 | 620 | if ( isset( $values['default_value'] ) && is_array( $values['default_value'] ) ) { |
@@ -823,8 +823,8 @@ discard block |
||
| 823 | 823 | continue; |
| 824 | 824 | } |
| 825 | 825 | |
| 826 | - $fields[ $result->id ] = $result; |
|
| 827 | - ++$count; |
|
| 826 | + $fields[$result->id] = $result; |
|
| 827 | + ++ $count; |
|
| 828 | 828 | if ( $limit == 1 ) { |
| 829 | 829 | $fields = $result; |
| 830 | 830 | break; |
@@ -876,8 +876,8 @@ discard block |
||
| 876 | 876 | $fields = array(); |
| 877 | 877 | $count = 0; |
| 878 | 878 | foreach ( $results as $result ) { |
| 879 | - ++$count; |
|
| 880 | - $fields[ $result->id ] = $result; |
|
| 879 | + ++ $count; |
|
| 880 | + $fields[$result->id] = $result; |
|
| 881 | 881 | if ( ! empty( $limit ) && $count >= $limit ) { |
| 882 | 882 | break; |
| 883 | 883 | } |
@@ -1004,7 +1004,7 @@ discard block |
||
| 1004 | 1004 | $query_type = $limit === ' LIMIT 1' || $limit == 1 ? 'row' : 'results'; |
| 1005 | 1005 | |
| 1006 | 1006 | if ( is_array( $where ) ) { |
| 1007 | - $args = array( |
|
| 1007 | + $args = array( |
|
| 1008 | 1008 | 'order_by' => $order_by, |
| 1009 | 1009 | 'limit' => $limit, |
| 1010 | 1010 | ); |
@@ -1041,9 +1041,9 @@ discard block |
||
| 1041 | 1041 | FrmDb::set_cache( $result->field_key, $result, 'frm_field' ); |
| 1042 | 1042 | |
| 1043 | 1043 | self::prepare_options( $result ); |
| 1044 | - $results[ $r_key ]->field_options = $result->field_options; |
|
| 1045 | - $results[ $r_key ]->options = $result->options; |
|
| 1046 | - $results[ $r_key ]->default_value = $result->default_value; |
|
| 1044 | + $results[$r_key]->field_options = $result->field_options; |
|
| 1045 | + $results[$r_key]->options = $result->options; |
|
| 1046 | + $results[$r_key]->default_value = $result->default_value; |
|
| 1047 | 1047 | |
| 1048 | 1048 | unset( $r_key, $result ); |
| 1049 | 1049 | } |
@@ -1138,7 +1138,7 @@ discard block |
||
| 1138 | 1138 | |
| 1139 | 1139 | if ( count( $next_fields ) >= self::$transient_size ) { |
| 1140 | 1140 | // if this transient is full, check for another |
| 1141 | - ++$next; |
|
| 1141 | + ++ $next; |
|
| 1142 | 1142 | self::get_next_transient( $fields, $base_name, $next ); |
| 1143 | 1143 | } |
| 1144 | 1144 | } |
@@ -1173,7 +1173,7 @@ discard block |
||
| 1173 | 1173 | return; |
| 1174 | 1174 | } |
| 1175 | 1175 | |
| 1176 | - ++$next; |
|
| 1176 | + ++ $next; |
|
| 1177 | 1177 | } |
| 1178 | 1178 | } |
| 1179 | 1179 | |
@@ -1335,7 +1335,7 @@ discard block |
||
| 1335 | 1335 | * @return bool |
| 1336 | 1336 | */ |
| 1337 | 1337 | public static function is_option_true_in_array( $field, $option ) { |
| 1338 | - return ! empty( $field[ $option ] ); |
|
| 1338 | + return ! empty( $field[$option] ); |
|
| 1339 | 1339 | } |
| 1340 | 1340 | |
| 1341 | 1341 | /** |
@@ -1345,7 +1345,7 @@ discard block |
||
| 1345 | 1345 | * @return bool |
| 1346 | 1346 | */ |
| 1347 | 1347 | public static function is_option_true_in_object( $field, $option ) { |
| 1348 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ]; |
|
| 1348 | + return isset( $field->field_options[$option] ) && $field->field_options[$option]; |
|
| 1349 | 1349 | } |
| 1350 | 1350 | |
| 1351 | 1351 | /** |
@@ -1355,7 +1355,7 @@ discard block |
||
| 1355 | 1355 | * @return bool |
| 1356 | 1356 | */ |
| 1357 | 1357 | public static function is_option_empty_in_array( $field, $option ) { |
| 1358 | - return empty( $field[ $option ] ); |
|
| 1358 | + return empty( $field[$option] ); |
|
| 1359 | 1359 | } |
| 1360 | 1360 | |
| 1361 | 1361 | /** |
@@ -1365,7 +1365,7 @@ discard block |
||
| 1365 | 1365 | * @return bool |
| 1366 | 1366 | */ |
| 1367 | 1367 | public static function is_option_empty_in_object( $field, $option ) { |
| 1368 | - return empty( $field->field_options[ $option ] ); |
|
| 1368 | + return empty( $field->field_options[$option] ); |
|
| 1369 | 1369 | } |
| 1370 | 1370 | |
| 1371 | 1371 | /** |
@@ -1375,7 +1375,7 @@ discard block |
||
| 1375 | 1375 | * @return bool |
| 1376 | 1376 | */ |
| 1377 | 1377 | public static function is_option_value_in_object( $field, $option ) { |
| 1378 | - return isset( $field->field_options[ $option ] ) && $field->field_options[ $option ] != ''; |
|
| 1378 | + return isset( $field->field_options[$option] ) && $field->field_options[$option] != ''; |
|
| 1379 | 1379 | } |
| 1380 | 1380 | |
| 1381 | 1381 | /** |
@@ -1403,10 +1403,10 @@ discard block |
||
| 1403 | 1403 | * @return mixed |
| 1404 | 1404 | */ |
| 1405 | 1405 | public static function get_option_in_array( $field, $option ) { |
| 1406 | - if ( isset( $field[ $option ] ) ) { |
|
| 1407 | - $this_option = $field[ $option ]; |
|
| 1408 | - } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][ $option ] ) ) { |
|
| 1409 | - $this_option = $field['field_options'][ $option ]; |
|
| 1406 | + if ( isset( $field[$option] ) ) { |
|
| 1407 | + $this_option = $field[$option]; |
|
| 1408 | + } elseif ( isset( $field['field_options'] ) && is_array( $field['field_options'] ) && isset( $field['field_options'][$option] ) ) { |
|
| 1409 | + $this_option = $field['field_options'][$option]; |
|
| 1410 | 1410 | } else { |
| 1411 | 1411 | $this_option = ''; |
| 1412 | 1412 | } |
@@ -1421,7 +1421,7 @@ discard block |
||
| 1421 | 1421 | * @return mixed |
| 1422 | 1422 | */ |
| 1423 | 1423 | public static function get_option_in_object( $field, $option ) { |
| 1424 | - return $field->field_options[ $option ] ?? ''; |
|
| 1424 | + return $field->field_options[$option] ?? ''; |
|
| 1425 | 1425 | } |
| 1426 | 1426 | |
| 1427 | 1427 | /** |
@@ -77,7 +77,7 @@ discard block |
||
| 77 | 77 | * |
| 78 | 78 | * @return string |
| 79 | 79 | */ |
| 80 | - function ( $position, $field ) { |
|
| 80 | + function( $position, $field ) { |
|
| 81 | 81 | if ( is_array( $field ) ) { |
| 82 | 82 | $this->default_label_position_field_ids[] = (int) $field['id']; |
| 83 | 83 | } |
@@ -95,7 +95,7 @@ discard block |
||
| 95 | 95 | * |
| 96 | 96 | * @return string |
| 97 | 97 | */ |
| 98 | - function ( $classes, $field ) { |
|
| 98 | + function( $classes, $field ) { |
|
| 99 | 99 | if ( is_array( $field ) && in_array( (int) $field['id'], $this->default_label_position_field_ids, true ) ) { |
| 100 | 100 | $classes .= ' frm-default-label-position'; |
| 101 | 101 | } |
@@ -123,7 +123,7 @@ discard block |
||
| 123 | 123 | * |
| 124 | 124 | * @return bool |
| 125 | 125 | */ |
| 126 | - function ( $show, $field_type ) { |
|
| 126 | + function( $show, $field_type ) { |
|
| 127 | 127 | if ( 'captcha' === $field_type ) { |
| 128 | 128 | $show = false; |
| 129 | 129 | } |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | * |
| 153 | 153 | * @return stdClass|null |
| 154 | 154 | */ |
| 155 | - function ( $form ) { |
|
| 155 | + function( $form ) { |
|
| 156 | 156 | if ( is_object( $form ) && is_array( $form->options ) ) { |
| 157 | 157 | $form->options['js_validate'] = false; |
| 158 | 158 | } |
@@ -202,7 +202,7 @@ discard block |
||
| 202 | 202 | |
| 203 | 203 | $frm_settings = FrmAppHelper::get_settings(); |
| 204 | 204 | if ( 'none' === $frm_settings->load_style ) { |
| 205 | - $notes[] = function () { |
|
| 205 | + $notes[] = function() { |
|
| 206 | 206 | printf( |
| 207 | 207 | // translators: %1$s: Anchor tag open, %2$s: Anchor tag close. |
| 208 | 208 | esc_html__( 'Formidable styles are disabled. This needs to be enabled in %1$sGlobal Settings%2$s.', 'formidable' ), |
@@ -393,7 +393,7 @@ discard block |
||
| 393 | 393 | return; |
| 394 | 394 | } |
| 395 | 395 | |
| 396 | - unset( $dependencies[ $index ] ); |
|
| 396 | + unset( $dependencies[$index] ); |
|
| 397 | 397 | $dependencies = array_values( $dependencies ); |
| 398 | 398 | |
| 399 | 399 | $styles->registered['wp-admin']->deps = $dependencies; |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | private static function has_dark_background( $style ) { |
| 143 | 143 | $key = 'fieldset_bg_color'; |
| 144 | 144 | |
| 145 | - if ( empty( $style->post_content[ $key ] ) ) { |
|
| 145 | + if ( empty( $style->post_content[$key] ) ) { |
|
| 146 | 146 | return false; |
| 147 | 147 | } |
| 148 | 148 | |
| 149 | - $color = $style->post_content[ $key ]; |
|
| 149 | + $color = $style->post_content[$key]; |
|
| 150 | 150 | |
| 151 | 151 | if ( 0 === strpos( $color, 'rgba' ) ) { |
| 152 | 152 | preg_match_all( '/([\\d.]+)/', $color, $matches ); |
@@ -209,7 +209,7 @@ discard block |
||
| 209 | 209 | * @param stdClass $style_object |
| 210 | 210 | * @param array $style |
| 211 | 211 | */ |
| 212 | - $param_filter = function ( $params, $args ) use ( $style_object, $style ) { |
|
| 212 | + $param_filter = function( $params, $args ) use ( $style_object, $style ) { |
|
| 213 | 213 | if ( $args['style'] !== $style_object ) { |
| 214 | 214 | return $params; |
| 215 | 215 | } |
@@ -222,7 +222,7 @@ discard block |
||
| 222 | 222 | ), |
| 223 | 223 | '/style-templates/' . $style['slug'] |
| 224 | 224 | ); |
| 225 | - $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
| 225 | + $params['data-requires'] = FrmFormsHelper::get_plan_required( $style ); |
|
| 226 | 226 | return $params; |
| 227 | 227 | }; |
| 228 | 228 | } else { |
@@ -234,7 +234,7 @@ discard block |
||
| 234 | 234 | * |
| 235 | 235 | * @return array |
| 236 | 236 | */ |
| 237 | - $param_filter = function ( $params ) use ( $style ) { |
|
| 237 | + $param_filter = function( $params ) use ( $style ) { |
|
| 238 | 238 | $params['data-template-key'] = $style['slug']; |
| 239 | 239 | return $params; |
| 240 | 240 | }; |
@@ -287,7 +287,7 @@ discard block |
||
| 287 | 287 | continue; |
| 288 | 288 | } |
| 289 | 289 | |
| 290 | - $value = $style->post_content[ $key ]; |
|
| 290 | + $value = $style->post_content[$key]; |
|
| 291 | 291 | |
| 292 | 292 | $is_hex = in_array( $key, $color_settings, true ) && $value && '#' !== $value[0] && false === strpos( $value, 'rgb' ) && $value !== 'transparent'; |
| 293 | 293 | if ( $is_hex ) { |
@@ -408,7 +408,7 @@ discard block |
||
| 408 | 408 | * |
| 409 | 409 | * @return void |
| 410 | 410 | */ |
| 411 | - function ( $style, $key ) { |
|
| 411 | + function( $style, $key ) { |
|
| 412 | 412 | if ( ! is_numeric( $key ) ) { |
| 413 | 413 | // Skip active_sub/expires keys. |
| 414 | 414 | return; |
@@ -437,10 +437,10 @@ discard block |
||
| 437 | 437 | * |
| 438 | 438 | * @return void |
| 439 | 439 | */ |
| 440 | - function ( $style ) use ( &$count ) { |
|
| 440 | + function( $style ) use ( &$count ) { |
|
| 441 | 441 | $hidden = $count > self::PAGE_SIZE - 1; |
| 442 | 442 | $this->echo_style_card( $style, $hidden ); |
| 443 | - ++$count; |
|
| 443 | + ++ $count; |
|
| 444 | 444 | } |
| 445 | 445 | ); |
| 446 | 446 | |
@@ -501,7 +501,7 @@ discard block |
||
| 501 | 501 | * |
| 502 | 502 | * @return bool |
| 503 | 503 | */ |
| 504 | - function ( $style ) { |
|
| 504 | + function( $style ) { |
|
| 505 | 505 | return $this->default_style->ID !== $style->ID; |
| 506 | 506 | } |
| 507 | 507 | ); |