@@ -320,10 +320,10 @@ discard block |
||
320 | 320 | |
321 | 321 | // Perform add or remove operation. |
322 | 322 | if ( 'add' === $operation ) { |
323 | - self::$favorite_templates[ $key ][ $template_id ] = $template_id; |
|
323 | + self::$favorite_templates[$key][$template_id] = $template_id; |
|
324 | 324 | } elseif ( 'remove' === $operation ) { |
325 | - if ( isset( self::$favorite_templates[ $key ][ $template_id ] ) ) { |
|
326 | - unset( self::$favorite_templates[ $key ][ $template_id ] ); |
|
325 | + if ( isset( self::$favorite_templates[$key][$template_id] ) ) { |
|
326 | + unset( self::$favorite_templates[$key][$template_id] ); |
|
327 | 327 | } |
328 | 328 | } |
329 | 329 | |
@@ -450,7 +450,7 @@ discard block |
||
450 | 450 | foreach ( self::$templates as $key => &$template ) { |
451 | 451 | // Skip the template if the categories are not set. |
452 | 452 | if ( ! isset( $template['categories'] ) ) { |
453 | - unset( self::$templates[ $key ] ); |
|
453 | + unset( self::$templates[$key] ); |
|
454 | 454 | continue; |
455 | 455 | } |
456 | 456 | |
@@ -464,14 +464,14 @@ discard block |
||
464 | 464 | // Add the slug to the new array. |
465 | 465 | $template['category_slugs'][] = $category_slug; |
466 | 466 | |
467 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
468 | - self::$categories[ $category_slug ] = array( |
|
467 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
468 | + self::$categories[$category_slug] = array( |
|
469 | 469 | 'name' => $category, |
470 | 470 | 'count' => 0, |
471 | 471 | ); |
472 | 472 | } |
473 | 473 | |
474 | - self::$categories[ $category_slug ]['count']++; |
|
474 | + self::$categories[$category_slug]['count'] ++; |
|
475 | 475 | } |
476 | 476 | |
477 | 477 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -484,7 +484,7 @@ discard block |
||
484 | 484 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::ignore_template_categories() ); |
485 | 485 | foreach ( $redundant_cats as $redundant_cat ) { |
486 | 486 | $category_slug = sanitize_title( $redundant_cat ); |
487 | - unset( self::$categories[ $category_slug ] ); |
|
487 | + unset( self::$categories[$category_slug] ); |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | // Sort the categories by keys alphabetically. |
@@ -508,7 +508,7 @@ discard block |
||
508 | 508 | 'count' => 0, // Assigned via JavaScript. |
509 | 509 | ); |
510 | 510 | } |
511 | - $special_categories['all-templates'] = array( |
|
511 | + $special_categories['all-templates'] = array( |
|
512 | 512 | 'name' => __( 'All Templates', 'formidable' ), |
513 | 513 | 'count' => count( self::$templates ), |
514 | 514 | ); |
@@ -535,9 +535,9 @@ discard block |
||
535 | 535 | */ |
536 | 536 | private static function assign_featured_templates() { |
537 | 537 | foreach ( self::FEATURED_TEMPLATES_KEYS as $key ) { |
538 | - if ( isset( self::$templates[ $key ] ) ) { |
|
539 | - self::$templates[ $key ]['is_featured'] = true; |
|
540 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
538 | + if ( isset( self::$templates[$key] ) ) { |
|
539 | + self::$templates[$key]['is_featured'] = true; |
|
540 | + self::$featured_templates[] = self::$templates[$key]; |
|
541 | 541 | } |
542 | 542 | } |
543 | 543 | } |
@@ -126,11 +126,11 @@ |
||
126 | 126 | foreach ( $payments as $payment ) { |
127 | 127 | list( $amount, $currency ) = FrmTransLiteAppHelper::get_amount_and_currency_from_payment( $payment ); |
128 | 128 | |
129 | - if ( ! isset( $data[ $currency ] ) ) { |
|
130 | - $data[ $currency ] = 0; |
|
129 | + if ( ! isset( $data[$currency] ) ) { |
|
130 | + $data[$currency] = 0; |
|
131 | 131 | } |
132 | 132 | |
133 | - $data[ $currency ] += floatval( $amount ); |
|
133 | + $data[$currency] += floatval( $amount ); |
|
134 | 134 | } |
135 | 135 | |
136 | 136 | return $data; |
@@ -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 |