@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | return; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if ( isset( self::$messages[ $message['key'] ] ) && ! isset( $message['force'] ) ) { |
|
| 108 | + if ( isset( self::$messages[$message['key']] ) && ! isset( $message['force'] ) ) { |
|
| 109 | 109 | // Don't replace messages unless required. |
| 110 | 110 | return; |
| 111 | 111 | } |
@@ -114,13 +114,13 @@ discard block |
||
| 114 | 114 | return; |
| 115 | 115 | } |
| 116 | 116 | |
| 117 | - if ( isset( self::$messages[ $message['key'] ] ) ) { |
|
| 117 | + if ( isset( self::$messages[$message['key']] ) ) { |
|
| 118 | 118 | // Move up and mark as new. |
| 119 | - unset( self::$messages[ $message['key'] ] ); |
|
| 119 | + unset( self::$messages[$message['key']] ); |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | $this->fill_message( $message ); |
| 123 | - self::$messages[ $message['key'] ] = $message; |
|
| 123 | + self::$messages[$message['key']] = $message; |
|
| 124 | 124 | |
| 125 | 125 | $this->update_list(); |
| 126 | 126 | |
@@ -156,11 +156,11 @@ discard block |
||
| 156 | 156 | private function clean_messages() { |
| 157 | 157 | $removed = false; |
| 158 | 158 | foreach ( self::$messages as $t => $message ) { |
| 159 | - $read = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][ get_current_user_id() ] ) && $message['read'][ get_current_user_id() ] < strtotime( '-1 month' ); |
|
| 160 | - $dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][ get_current_user_id() ] ) && $message['dismissed'][ get_current_user_id() ] < strtotime( '-1 week' ); |
|
| 159 | + $read = isset( $message['read'] ) && ! empty( $message['read'] ) && isset( $message['read'][get_current_user_id()] ) && $message['read'][get_current_user_id()] < strtotime( '-1 month' ); |
|
| 160 | + $dismissed = isset( $message['dismissed'] ) && ! empty( $message['dismissed'] ) && isset( $message['dismissed'][get_current_user_id()] ) && $message['dismissed'][get_current_user_id()] < strtotime( '-1 week' ); |
|
| 161 | 161 | $expired = $this->is_expired( $message ); |
| 162 | 162 | if ( $read || $expired || $dismissed ) { |
| 163 | - unset( self::$messages[ $t ] ); |
|
| 163 | + unset( self::$messages[$t] ); |
|
| 164 | 164 | $removed = true; |
| 165 | 165 | } |
| 166 | 166 | } |
@@ -176,11 +176,11 @@ discard block |
||
| 176 | 176 | public function filter_messages( &$messages, $type = 'unread' ) { |
| 177 | 177 | $user_id = get_current_user_id(); |
| 178 | 178 | foreach ( $messages as $k => $message ) { |
| 179 | - $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][ $user_id ] ); |
|
| 179 | + $dismissed = isset( $message['dismissed'] ) && isset( $message['dismissed'][$user_id] ); |
|
| 180 | 180 | if ( empty( $k ) || $this->is_expired( $message ) || ( $dismissed && 'dismissed' !== $type ) || ( 'dismissed' === $type && ! $dismissed ) ) { |
| 181 | - unset( $messages[ $k ] ); |
|
| 181 | + unset( $messages[$k] ); |
|
| 182 | 182 | } elseif ( ! $this->is_for_user( $message ) ) { |
| 183 | - unset( $messages[ $k ] ); |
|
| 183 | + unset( $messages[$k] ); |
|
| 184 | 184 | } |
| 185 | 185 | } |
| 186 | 186 | $messages = apply_filters( 'frm_filter_inbox', $messages ); |
@@ -226,14 +226,14 @@ discard block |
||
| 226 | 226 | * @return void |
| 227 | 227 | */ |
| 228 | 228 | public function mark_read( $key ) { |
| 229 | - if ( ! $key || ! isset( self::$messages[ $key ] ) ) { |
|
| 229 | + if ( ! $key || ! isset( self::$messages[$key] ) ) { |
|
| 230 | 230 | return; |
| 231 | 231 | } |
| 232 | 232 | |
| 233 | - if ( ! isset( self::$messages[ $key ]['read'] ) ) { |
|
| 234 | - self::$messages[ $key ]['read'] = array(); |
|
| 233 | + if ( ! isset( self::$messages[$key]['read'] ) ) { |
|
| 234 | + self::$messages[$key]['read'] = array(); |
|
| 235 | 235 | } |
| 236 | - self::$messages[ $key ]['read'][ get_current_user_id() ] = time(); |
|
| 236 | + self::$messages[$key]['read'][get_current_user_id()] = time(); |
|
| 237 | 237 | |
| 238 | 238 | $this->update_list(); |
| 239 | 239 | } |
@@ -246,9 +246,9 @@ discard block |
||
| 246 | 246 | * @return void |
| 247 | 247 | */ |
| 248 | 248 | public function mark_unread( $key ) { |
| 249 | - $is_read = isset( self::$messages[ $key ] ) && isset( self::$messages[ $key ]['read'] ) && isset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 249 | + $is_read = isset( self::$messages[$key] ) && isset( self::$messages[$key]['read'] ) && isset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
| 250 | 250 | if ( $is_read ) { |
| 251 | - unset( self::$messages[ $key ]['read'][ get_current_user_id() ] ); |
|
| 251 | + unset( self::$messages[$key]['read'][get_current_user_id()] ); |
|
| 252 | 252 | $this->update_list(); |
| 253 | 253 | } |
| 254 | 254 | } |
@@ -264,14 +264,14 @@ discard block |
||
| 264 | 264 | return; |
| 265 | 265 | } |
| 266 | 266 | |
| 267 | - if ( ! isset( self::$messages[ $key ] ) ) { |
|
| 267 | + if ( ! isset( self::$messages[$key] ) ) { |
|
| 268 | 268 | return; |
| 269 | 269 | } |
| 270 | 270 | |
| 271 | - if ( ! isset( self::$messages[ $key ]['dismissed'] ) ) { |
|
| 272 | - self::$messages[ $key ]['dismissed'] = array(); |
|
| 271 | + if ( ! isset( self::$messages[$key]['dismissed'] ) ) { |
|
| 272 | + self::$messages[$key]['dismissed'] = array(); |
|
| 273 | 273 | } |
| 274 | - self::$messages[ $key ]['dismissed'][ get_current_user_id() ] = time(); |
|
| 274 | + self::$messages[$key]['dismissed'][get_current_user_id()] = time(); |
|
| 275 | 275 | |
| 276 | 276 | $this->update_list(); |
| 277 | 277 | } |
@@ -285,11 +285,11 @@ discard block |
||
| 285 | 285 | $user_id = get_current_user_id(); |
| 286 | 286 | foreach ( self::$messages as $key => $message ) { |
| 287 | 287 | if ( ! isset( $message['dismissed'] ) ) { |
| 288 | - self::$messages[ $key ]['dismissed'] = array(); |
|
| 288 | + self::$messages[$key]['dismissed'] = array(); |
|
| 289 | 289 | } |
| 290 | 290 | |
| 291 | - if ( ! isset( $message['dismissed'][ $user_id ] ) ) { |
|
| 292 | - self::$messages[ $key ]['dismissed'][ $user_id ] = time(); |
|
| 291 | + if ( ! isset( $message['dismissed'][$user_id] ) ) { |
|
| 292 | + self::$messages[$key]['dismissed'][$user_id] = time(); |
|
| 293 | 293 | } |
| 294 | 294 | } |
| 295 | 295 | $this->update_list(); |
@@ -299,8 +299,8 @@ discard block |
||
| 299 | 299 | $messages = $this->get_messages( 'filter' ); |
| 300 | 300 | $user_id = get_current_user_id(); |
| 301 | 301 | foreach ( $messages as $t => $message ) { |
| 302 | - if ( isset( $message['read'] ) && isset( $message['read'][ $user_id ] ) ) { |
|
| 303 | - unset( $messages[ $t ] ); |
|
| 302 | + if ( isset( $message['read'] ) && isset( $message['read'][$user_id] ) ) { |
|
| 303 | + unset( $messages[$t] ); |
|
| 304 | 304 | } |
| 305 | 305 | } |
| 306 | 306 | return $messages; |
@@ -328,8 +328,8 @@ discard block |
||
| 328 | 328 | * @return void |
| 329 | 329 | */ |
| 330 | 330 | public function remove( $key ) { |
| 331 | - if ( isset( self::$messages[ $key ] ) ) { |
|
| 332 | - unset( self::$messages[ $key ] ); |
|
| 331 | + if ( isset( self::$messages[$key] ) ) { |
|
| 332 | + unset( self::$messages[$key] ); |
|
| 333 | 333 | $this->update_list(); |
| 334 | 334 | } |
| 335 | 335 | } |
@@ -15,20 +15,26 @@ |
||
| 15 | 15 | <h4><?php echo esc_html( $counter['heading'] ); ?></h4> |
| 16 | 16 | <?php if ( isset( $counter['cta'] ) && isset( $counter['cta']['display'] ) && true === $counter['cta']['display'] ) : ?> |
| 17 | 17 | <a href="<?php echo esc_url( $counter['cta']['link'] ); ?>"><?php echo esc_attr( $counter['cta']['title'] ); ?></a> |
| 18 | - <?php else : ?> |
|
| 18 | + <?php else { |
|
| 19 | + : ?> |
|
| 19 | 20 | <?php if ( 'currency' === $counter['type'] ) : ?> |
| 20 | 21 | <div class="frm-flex-box frm-gap-md"> |
| 21 | 22 | <?php foreach ( $counter['items'] as $item ) : ?> |
| 22 | 23 | <b> |
| 23 | - <?php echo esc_attr( $item['counter_label']['symbol_left'] ); ?> |
|
| 24 | + <?php echo esc_attr( $item['counter_label']['symbol_left'] ); |
|
| 25 | +} |
|
| 26 | +?> |
|
| 24 | 27 | <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $item['counter']; ?>"><?php echo (int) $item['counter']; ?></span> |
| 25 | 28 | <?php echo esc_attr( $item['counter_label']['symbol_right'] ); ?> |
| 26 | 29 | </b> |
| 27 | 30 | <?php endforeach; ?> |
| 28 | 31 | </div> |
| 29 | - <?php else : ?> |
|
| 32 | + <?php else { |
|
| 33 | + : ?> |
|
| 30 | 34 | <b> |
| 31 | - <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); ?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span> |
|
| 35 | + <span class="frm-counter" data-type="<?php echo esc_attr( $counter['type'] ); |
|
| 36 | +} |
|
| 37 | +?>" data-locale="<?php echo esc_attr( get_locale() ); ?>" data-counter="<?php echo (int) $counter['counter']; ?>"><?php echo (int) $counter['counter']; ?></span> |
|
| 32 | 38 | </b> |
| 33 | 39 | <?php endif; ?> |
| 34 | 40 | <?php endif; ?> |
@@ -377,12 +377,12 @@ discard block |
||
| 377 | 377 | if ( $form_id ) { |
| 378 | 378 | self::get_columns_for_form( $form_id, $columns ); |
| 379 | 379 | } else { |
| 380 | - $columns[ $form_id . '_form_id' ] = __( 'Form', 'formidable' ); |
|
| 381 | - $columns[ $form_id . '_name' ] = __( 'Name', 'formidable' ); |
|
| 382 | - $columns[ $form_id . '_user_id' ] = __( 'Author', 'formidable' ); |
|
| 380 | + $columns[$form_id . '_form_id'] = __( 'Form', 'formidable' ); |
|
| 381 | + $columns[$form_id . '_name'] = __( 'Name', 'formidable' ); |
|
| 382 | + $columns[$form_id . '_user_id'] = __( 'Author', 'formidable' ); |
|
| 383 | 383 | } |
| 384 | 384 | |
| 385 | - $columns[ $form_id . '_created_at' ] = __( 'Created on', 'formidable' ); |
|
| 385 | + $columns[$form_id . '_created_at'] = __( 'Created on', 'formidable' ); |
|
| 386 | 386 | |
| 387 | 387 | return $columns; |
| 388 | 388 | } |
@@ -545,11 +545,11 @@ discard block |
||
| 545 | 545 | */ |
| 546 | 546 | private static function get_dashboard_options( $option_name = null ) { |
| 547 | 547 | $options = get_option( self::$option_meta_name, array() ); |
| 548 | - if ( null !== $option_name && ! isset( $options[ $option_name ] ) ) { |
|
| 548 | + if ( null !== $option_name && ! isset( $options[$option_name] ) ) { |
|
| 549 | 549 | return array(); |
| 550 | 550 | } |
| 551 | 551 | if ( null !== $option_name ) { |
| 552 | - return $options[ $option_name ]; |
|
| 552 | + return $options[$option_name]; |
|
| 553 | 553 | } |
| 554 | 554 | return $options; |
| 555 | 555 | } |
@@ -564,7 +564,7 @@ discard block |
||
| 564 | 564 | */ |
| 565 | 565 | private static function update_dashboard_options( $data, $option_name ) { |
| 566 | 566 | $options = self::get_dashboard_options(); |
| 567 | - $options[ $option_name ] = $data; |
|
| 567 | + $options[$option_name] = $data; |
|
| 568 | 568 | update_option( self::$option_meta_name, $options, 'no' ); |
| 569 | 569 | } |
| 570 | 570 | |
@@ -235,8 +235,8 @@ discard block |
||
| 235 | 235 | return $this->get_pagenum(); |
| 236 | 236 | } |
| 237 | 237 | |
| 238 | - if ( isset( $this->_pagination_args[ $key ] ) ) { |
|
| 239 | - return $this->_pagination_args[ $key ]; |
|
| 238 | + if ( isset( $this->_pagination_args[$key] ) ) { |
|
| 239 | + return $this->_pagination_args[$key]; |
|
| 240 | 240 | } |
| 241 | 241 | } |
| 242 | 242 | |
@@ -284,8 +284,8 @@ discard block |
||
| 284 | 284 | } |
| 285 | 285 | |
| 286 | 286 | private function hidden_search_inputs( $param_name ) { |
| 287 | - if ( ! empty( $_REQUEST[ $param_name ] ) ) { |
|
| 288 | - $value = sanitize_text_field( wp_unslash( $_REQUEST[ $param_name ] ) ); |
|
| 287 | + if ( ! empty( $_REQUEST[$param_name] ) ) { |
|
| 288 | + $value = sanitize_text_field( wp_unslash( $_REQUEST[$param_name] ) ); |
|
| 289 | 289 | echo '<input type="hidden" name="' . esc_attr( $param_name ) . '" value="' . esc_attr( $value ) . '" />'; |
| 290 | 290 | } |
| 291 | 291 | } |
@@ -329,7 +329,7 @@ discard block |
||
| 329 | 329 | |
| 330 | 330 | echo "<ul class='subsubsub'>\n"; |
| 331 | 331 | foreach ( $views as $class => $view ) { |
| 332 | - $views[ $class ] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 332 | + $views[$class] = "\t" . '<li class="' . esc_attr( $class ) . '">' . $view; |
|
| 333 | 333 | } |
| 334 | 334 | echo implode( " |</li>\n", $views ) . "</li>\n"; // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped |
| 335 | 335 | echo '</ul>'; |
@@ -709,7 +709,7 @@ discard block |
||
| 709 | 709 | 'next' => __( 'Next page', 'formidable' ), |
| 710 | 710 | ); |
| 711 | 711 | |
| 712 | - return $labels[ $link ]; |
|
| 712 | + return $labels[$link]; |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | private function current_url() { |
@@ -802,7 +802,7 @@ discard block |
||
| 802 | 802 | |
| 803 | 803 | // If the primary column doesn't exist fall back to the |
| 804 | 804 | // first non-checkbox column. |
| 805 | - if ( ! isset( $columns[ $default ] ) ) { |
|
| 805 | + if ( ! isset( $columns[$default] ) ) { |
|
| 806 | 806 | $default = self::get_default_primary_column_name(); |
| 807 | 807 | } |
| 808 | 808 | |
@@ -816,7 +816,7 @@ discard block |
||
| 816 | 816 | */ |
| 817 | 817 | $column = apply_filters( 'list_table_primary_column', $default, $this->screen->id ); |
| 818 | 818 | |
| 819 | - if ( empty( $column ) || ! isset( $columns[ $column ] ) ) { |
|
| 819 | + if ( empty( $column ) || ! isset( $columns[$column] ) ) { |
|
| 820 | 820 | $column = $default; |
| 821 | 821 | } |
| 822 | 822 | |
@@ -838,7 +838,7 @@ discard block |
||
| 838 | 838 | // In 4.3, we added a fourth argument for primary column. |
| 839 | 839 | $column_headers = array( array(), array(), array(), $this->get_primary_column_name() ); |
| 840 | 840 | foreach ( $this->_column_headers as $key => $value ) { |
| 841 | - $column_headers[ $key ] = $value; |
|
| 841 | + $column_headers[$key] = $value; |
|
| 842 | 842 | } |
| 843 | 843 | |
| 844 | 844 | return $column_headers; |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | $data[1] = false; |
| 872 | 872 | } |
| 873 | 873 | |
| 874 | - $sortable[ $id ] = $data; |
|
| 874 | + $sortable[$id] = $data; |
|
| 875 | 875 | } |
| 876 | 876 | |
| 877 | 877 | $primary = $this->get_primary_column_name(); |
@@ -948,8 +948,8 @@ discard block |
||
| 948 | 948 | $class[] = 'column-primary'; |
| 949 | 949 | } |
| 950 | 950 | |
| 951 | - if ( isset( $sortable[ $column_key ] ) ) { |
|
| 952 | - list( $orderby, $desc_first ) = $sortable[ $column_key ]; |
|
| 951 | + if ( isset( $sortable[$column_key] ) ) { |
|
| 952 | + list( $orderby, $desc_first ) = $sortable[$column_key]; |
|
| 953 | 953 | |
| 954 | 954 | if ( $current_orderby == $orderby ) { |
| 955 | 955 | $order = 'asc' == $current_order ? 'desc' : 'asc'; |
@@ -1033,7 +1033,7 @@ discard block |
||
| 1033 | 1033 | * @return bool Returns true if the setting is not set or if it is not false; otherwise, returns false. |
| 1034 | 1034 | */ |
| 1035 | 1035 | protected function should_display( $args, $settings ) { |
| 1036 | - return ! isset( $args[ $settings ] ) || false !== $args[ $settings ]; |
|
| 1036 | + return ! isset( $args[$settings] ) || false !== $args[$settings]; |
|
| 1037 | 1037 | } |
| 1038 | 1038 | |
| 1039 | 1039 | /** |
@@ -330,11 +330,11 @@ discard block |
||
| 330 | 330 | |
| 331 | 331 | // Perform add or remove operation. |
| 332 | 332 | if ( 'add' === $operation ) { |
| 333 | - self::$favorite_templates[ $key ][] = $template_id; |
|
| 333 | + self::$favorite_templates[$key][] = $template_id; |
|
| 334 | 334 | } elseif ( 'remove' === $operation ) { |
| 335 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
| 335 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
| 336 | 336 | if ( $position !== false ) { |
| 337 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
| 337 | + unset( self::$favorite_templates[$key][$position] ); |
|
| 338 | 338 | } |
| 339 | 339 | } |
| 340 | 340 | |
@@ -463,7 +463,7 @@ discard block |
||
| 463 | 463 | foreach ( self::$templates as $key => &$template ) { |
| 464 | 464 | // Skip the template if the categories are not set. |
| 465 | 465 | if ( ! isset( $template['categories'] ) ) { |
| 466 | - unset( self::$templates[ $key ] ); |
|
| 466 | + unset( self::$templates[$key] ); |
|
| 467 | 467 | continue; |
| 468 | 468 | } |
| 469 | 469 | |
@@ -477,14 +477,14 @@ discard block |
||
| 477 | 477 | // Add the slug to the new array. |
| 478 | 478 | $template['category_slugs'][] = $category_slug; |
| 479 | 479 | |
| 480 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 481 | - self::$categories[ $category_slug ] = array( |
|
| 480 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 481 | + self::$categories[$category_slug] = array( |
|
| 482 | 482 | 'name' => $category, |
| 483 | 483 | 'count' => 0, |
| 484 | 484 | ); |
| 485 | 485 | } |
| 486 | 486 | |
| 487 | - self::$categories[ $category_slug ]['count']++; |
|
| 487 | + self::$categories[$category_slug]['count'] ++; |
|
| 488 | 488 | } |
| 489 | 489 | |
| 490 | 490 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -499,7 +499,7 @@ discard block |
||
| 499 | 499 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() ); |
| 500 | 500 | foreach ( $redundant_cats as $redundant_cat ) { |
| 501 | 501 | $category_slug = sanitize_title( $redundant_cat ); |
| 502 | - unset( self::$categories[ $category_slug ] ); |
|
| 502 | + unset( self::$categories[$category_slug] ); |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | // Sort the categories by keys alphabetically. |
@@ -524,7 +524,7 @@ discard block |
||
| 524 | 524 | 'count' => 0, |
| 525 | 525 | ); |
| 526 | 526 | } |
| 527 | - $special_categories['all-templates'] = array( |
|
| 527 | + $special_categories['all-templates'] = array( |
|
| 528 | 528 | 'name' => __( 'All Templates', 'formidable' ), |
| 529 | 529 | 'count' => self::get_template_count(), |
| 530 | 530 | ); |
@@ -552,9 +552,9 @@ discard block |
||
| 552 | 552 | */ |
| 553 | 553 | private static function assign_featured_templates() { |
| 554 | 554 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
| 555 | - if ( isset( self::$templates[ $key ] ) ) { |
|
| 556 | - self::$templates[ $key ]['is_featured'] = true; |
|
| 557 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
| 555 | + if ( isset( self::$templates[$key] ) ) { |
|
| 556 | + self::$templates[$key]['is_featured'] = true; |
|
| 557 | + self::$featured_templates[] = self::$templates[$key]; |
|
| 558 | 558 | } |
| 559 | 559 | } |
| 560 | 560 | } |