@@ -89,8 +89,8 @@ discard block |
||
| 89 | 89 | public function __construct( $data ) { |
| 90 | 90 | $sections = array( 'counters', 'license', 'get_free_templates', 'payments', 'entries', 'inbox', 'video', 'payments' ); |
| 91 | 91 | foreach ( $sections as $section ) { |
| 92 | - if ( isset( $data[ $section ] ) ) { |
|
| 93 | - $this->view[ $section ] = $data[ $section ]; |
|
| 92 | + if ( isset( $data[$section] ) ) { |
|
| 93 | + $this->view[$section] = $data[$section]; |
|
| 94 | 94 | } |
| 95 | 95 | } |
| 96 | 96 | } |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | private static function load_entries_list_template( $template ) { |
| 366 | 366 | add_filter( |
| 367 | 367 | 'formidable_page_formidable_entries_per_page', |
| 368 | - function () { |
|
| 368 | + function() { |
|
| 369 | 369 | return 7; |
| 370 | 370 | } |
| 371 | 371 | ); |
@@ -239,7 +239,7 @@ discard block |
||
| 239 | 239 | 'description' => esc_html__( 'Just add your email address and you\'ll get 30+ free form templates to your account.', 'formidable' ), |
| 240 | 240 | 'submit_button_text' => esc_html_x( 'Get Templates', 'get free templates modal submit button text', 'formidable' ), |
| 241 | 241 | ); |
| 242 | - $view_parts[] = 'modals/leave-email-modal.php'; |
|
| 242 | + $view_parts[] = 'modals/leave-email-modal.php'; |
|
| 243 | 243 | } |
| 244 | 244 | |
| 245 | 245 | // Add 'upgrade' modal view for non-elite users. |
@@ -338,11 +338,11 @@ discard block |
||
| 338 | 338 | |
| 339 | 339 | // Perform add or remove operation. |
| 340 | 340 | if ( 'add' === $operation ) { |
| 341 | - self::$favorite_templates[ $key ][] = $template_id; |
|
| 341 | + self::$favorite_templates[$key][] = $template_id; |
|
| 342 | 342 | } elseif ( 'remove' === $operation ) { |
| 343 | - $position = array_search( $template_id, self::$favorite_templates[ $key ], true ); |
|
| 343 | + $position = array_search( $template_id, self::$favorite_templates[$key], true ); |
|
| 344 | 344 | if ( $position !== false ) { |
| 345 | - unset( self::$favorite_templates[ $key ][ $position ] ); |
|
| 345 | + unset( self::$favorite_templates[$key][$position] ); |
|
| 346 | 346 | } |
| 347 | 347 | } |
| 348 | 348 | |
@@ -500,7 +500,7 @@ discard block |
||
| 500 | 500 | foreach ( self::$templates as $key => &$template ) { |
| 501 | 501 | // Skip the template if the categories are not set. |
| 502 | 502 | if ( ! isset( $template['categories'] ) || ! isset( $template['id'] ) ) { |
| 503 | - unset( self::$templates[ $key ] ); |
|
| 503 | + unset( self::$templates[$key] ); |
|
| 504 | 504 | continue; |
| 505 | 505 | } |
| 506 | 506 | |
@@ -514,14 +514,12 @@ discard block |
||
| 514 | 514 | // Add the slug to the new array. |
| 515 | 515 | $template['category_slugs'][] = $category_slug; |
| 516 | 516 | |
| 517 | - if ( ! isset( self::$categories[ $category_slug ] ) ) { |
|
| 518 | - self::$categories[ $category_slug ] = array( |
|
| 517 | + if ( ! isset( self::$categories[$category_slug] ) ) { |
|
| 518 | + self::$categories[$category_slug] = array( |
|
| 519 | 519 | 'name' => $category, |
| 520 | 520 | 'count' => 0, |
| 521 | 521 | ); |
| 522 | - } |
|
| 523 | - |
|
| 524 | - ++self::$categories[ $category_slug ]['count']; |
|
| 522 | + } ++self::$categories[$category_slug]['count']; |
|
| 525 | 523 | } |
| 526 | 524 | |
| 527 | 525 | // Mark the template as favorite if it's in the favorite templates list. |
@@ -536,7 +534,7 @@ discard block |
||
| 536 | 534 | $redundant_cats = array_merge( array( 'PayPal', 'Stripe', 'Twilio' ), FrmFormsHelper::get_license_types() ); |
| 537 | 535 | foreach ( $redundant_cats as $redundant_cat ) { |
| 538 | 536 | $category_slug = sanitize_title( $redundant_cat ); |
| 539 | - unset( self::$categories[ $category_slug ] ); |
|
| 537 | + unset( self::$categories[$category_slug] ); |
|
| 540 | 538 | } |
| 541 | 539 | |
| 542 | 540 | // Sort the categories by keys alphabetically. |
@@ -561,7 +559,7 @@ discard block |
||
| 561 | 559 | 'count' => 0, |
| 562 | 560 | ); |
| 563 | 561 | } |
| 564 | - $special_categories['all-items'] = array( |
|
| 562 | + $special_categories['all-items'] = array( |
|
| 565 | 563 | 'name' => __( 'All Templates', 'formidable' ), |
| 566 | 564 | 'count' => self::get_template_count(), |
| 567 | 565 | ); |
@@ -584,9 +582,9 @@ discard block |
||
| 584 | 582 | */ |
| 585 | 583 | private static function assign_featured_templates() { |
| 586 | 584 | foreach ( self::FEATURED_TEMPLATES_IDS as $key ) { |
| 587 | - if ( isset( self::$templates[ $key ] ) ) { |
|
| 588 | - self::$templates[ $key ]['is_featured'] = true; |
|
| 589 | - self::$featured_templates[] = self::$templates[ $key ]; |
|
| 585 | + if ( isset( self::$templates[$key] ) ) { |
|
| 586 | + self::$templates[$key]['is_featured'] = true; |
|
| 587 | + self::$featured_templates[] = self::$templates[$key]; |
|
| 590 | 588 | } |
| 591 | 589 | } |
| 592 | 590 | } |