@@ -236,11 +236,11 @@ discard block |
||
236 | 236 | */ |
237 | 237 | public static function get_last_sent_date( $type ) { |
238 | 238 | $options = self::get_options(); |
239 | - if ( empty( $options[ 'last_' . $type ] ) ) { |
|
239 | + if ( empty( $options['last_' . $type] ) ) { |
|
240 | 240 | return false; |
241 | 241 | } |
242 | 242 | |
243 | - return $options[ 'last_' . $type ]; |
|
243 | + return $options['last_' . $type]; |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | /** |
@@ -252,7 +252,7 @@ discard block |
||
252 | 252 | public static function set_last_sent_date( $type, $value = null ) { |
253 | 253 | $options = self::get_options(); |
254 | 254 | |
255 | - $options[ 'last_' . $type ] = null === $value ? self::get_date_from_today() : ''; |
|
255 | + $options['last_' . $type] = null === $value ? self::get_date_from_today() : ''; |
|
256 | 256 | self::save_options( $options ); |
257 | 257 | } |
258 | 258 |
@@ -329,11 +329,11 @@ discard block |
||
329 | 329 | |
330 | 330 | // Perform add or remove operation. |
331 | 331 | if ( 'add' === $operation ) { |
332 | - self::$favorite_templates[ $key ][] = $template_id; |
|
332 | + self::$favorite_templates[$key][] = $template_id; |
|
333 | 333 | } elseif ( 'remove' === $operation ) { |
334 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
334 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
335 | 335 | if ( $position !== false ) { |
336 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
336 | + unset( self::$favorite_templates[$key][$position] ); |
|
337 | 337 | } |
338 | 338 | } |
339 | 339 | |
@@ -462,7 +462,7 @@ discard block |
||
462 | 462 | foreach ( self::$templates as $key => &$template ) { |
463 | 463 | // Skip the template if the categories are not set. |
464 | 464 | if ( ! isset( $template['categories'] ) ) { |
465 | - unset( self::$templates[ $key ] ); |
|
465 | + unset( self::$templates[$key] ); |
|
466 | 466 | continue; |
467 | 467 | } |
468 | 468 | |
@@ -476,14 +476,14 @@ discard block |
||
476 | 476 | // Add the slug to the new array. |
477 | 477 | $template['category_slugs'][] = $category_slug; |
478 | 478 | |
479 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
480 | - self::$categories[ $category_slug ] = array( |
|
479 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
480 | + self::$categories[$category_slug] = array( |
|
481 | 481 | 'name' => $category, |
482 | 482 | 'count' => 0, |
483 | 483 | ); |
484 | 484 | } |
485 | 485 | |
486 | - self::$categories[ $category_slug ]['count']++; |
|
486 | + self::$categories[$category_slug]['count'] ++; |
|
487 | 487 | } |
488 | 488 | |
489 | 489 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -496,7 +496,7 @@ discard block |
||
496 | 496 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() ); |
497 | 497 | foreach ( $redundant_cats as $redundant_cat ) { |
498 | 498 | $category_slug = sanitize_title( $redundant_cat ); |
499 | - unset( self::$categories[ $category_slug ] ); |
|
499 | + unset( self::$categories[$category_slug] ); |
|
500 | 500 | } |
501 | 501 | |
502 | 502 | // Sort the categories by keys alphabetically. |
@@ -520,7 +520,7 @@ discard block |
||
520 | 520 | 'count' => 0, // Assigned via JavaScript. |
521 | 521 | ); |
522 | 522 | } |
523 | - $special_categories['all-templates'] = array( |
|
523 | + $special_categories['all-templates'] = array( |
|
524 | 524 | 'name' => __( 'All Templates', 'formidable' ), |
525 | 525 | 'count' => self::get_template_count(), |
526 | 526 | ); |
@@ -547,9 +547,9 @@ discard block |
||
547 | 547 | */ |
548 | 548 | private static function assign_featured_templates() { |
549 | 549 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
550 | - if ( isset( self::$templates[ $key ] ) ) { |
|
551 | - self::$templates[ $key ]['is_featured'] = true; |
|
552 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
550 | + if ( isset( self::$templates[$key] ) ) { |
|
551 | + self::$templates[$key]['is_featured'] = true; |
|
552 | + self::$featured_templates[] = self::$templates[$key]; |
|
553 | 553 | } |
554 | 554 | } |
555 | 555 | } |
@@ -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 | /** |