Completed
Push — develop ( a5dc6d...6bdcba )
by
unknown
19:46
created
includes/admin/metaboxes/views/select-template.php 1 patch
Spacing   +29 added lines, -29 removed lines patch added patch discarded remove patch
@@ -16,16 +16,16 @@  discard block
 block discarded – undo
16 16
 
17 17
 $templates = gravityview_get_registered_templates();
18 18
 
19
-$wp_plugins = [];
19
+$wp_plugins = [ ];
20 20
 
21 21
 foreach ( GravityKitFoundation::helpers()->core->get_plugins() as $path => $plugin ) {
22
-	if ( empty( $plugin['TextDomain'] ) ) {
22
+	if ( empty( $plugin[ 'TextDomain' ] ) ) {
23 23
 		continue;
24 24
 	}
25 25
 
26
-	$wp_plugins[ $plugin['TextDomain'] ] = array(
26
+	$wp_plugins[ $plugin[ 'TextDomain' ] ] = array(
27 27
 		'path'      => $path,
28
-		'version'   => $plugin['Version'],
28
+		'version'   => $plugin[ 'Version' ],
29 29
 		'activated' => is_plugin_active( $path )
30 30
 	);
31 31
 }
@@ -40,54 +40,54 @@  discard block
 block discarded – undo
40 40
 
41 41
 <?php // list all the available templates (type= fresh or custom ) ?>
42 42
 <div class="gv-grid">
43
-	<?php foreach( $templates as $id => $template ) {
43
+	<?php foreach ( $templates as $id => $template ) {
44 44
 		$selected             = ( $id == $current_template ) ? ' gv-selected' : '';
45
-		$placeholder          = ! empty( $template['buy_source'] );
46
-		$is_included          = ! empty( $template['included'] );
45
+		$placeholder          = ! empty( $template[ 'buy_source' ] );
46
+		$is_included          = ! empty( $template[ 'included' ] );
47 47
 		$template_text_domain = GravityKitFoundation::helpers()->array->get( $template, 'textdomain', '' );
48
-		$plugin_data          = GravityKitFoundation::licenses()->product_manager()->get_installed_plugin_by_text_domain( $template_text_domain ) ?: [];
48
+		$plugin_data          = GravityKitFoundation::licenses()->product_manager()->get_installed_plugin_by_text_domain( $template_text_domain ) ?: [ ];
49 49
 		$button_text          = empty( $plugin_data ) ? esc_html__( 'Install', 'gk-gravityview' ) : esc_html__( 'Activate & Select', 'gk-gravityview' );
50 50
 		$button_class         = 'gv-layout-' . ( empty( $plugin_data ) ? 'install' : 'activate' );
51
-		$template_path        = isset( $plugin_data['path'] ) ? $plugin_data['path'] : '';
52
-		$template_id          = isset( $template['template_id'] ) ? $template['template_id'] : '';
53
-		$download_id          = isset( $template['download_id'] ) ? $template['download_id'] : '';
51
+		$template_path        = isset( $plugin_data[ 'path' ] ) ? $plugin_data[ 'path' ] : '';
52
+		$template_id          = isset( $template[ 'template_id' ] ) ? $template[ 'template_id' ] : '';
53
+		$download_id          = isset( $template[ 'download_id' ] ) ? $template[ 'download_id' ] : '';
54 54
 		?>
55 55
 		<div class="gv-grid-col-1-4">
56
-			<div class="gv-view-types-module<?php echo $selected; if( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template['type'] ); ?>">
56
+			<div class="gv-view-types-module<?php echo $selected; if ( $placeholder ) { echo ' gv-view-template-placeholder'; } ?>" data-filter="<?php echo esc_attr( $template[ 'type' ] ); ?>">
57 57
 				<div class="gv-view-types-normal">
58
-					<img src="<?php echo esc_url( $template['logo'] ); ?>" alt="<?php echo esc_attr( $template['label'] ); ?>">
59
-					<h5><?php echo esc_html( $template['label'] ); ?></h5>
60
-					<p class="description"><?php echo esc_html( $template['description'] ); ?></p>
58
+					<img src="<?php echo esc_url( $template[ 'logo' ] ); ?>" alt="<?php echo esc_attr( $template[ 'label' ] ); ?>">
59
+					<h5><?php echo esc_html( $template[ 'label' ] ); ?></h5>
60
+					<p class="description"><?php echo esc_html( $template[ 'description' ] ); ?></p>
61 61
 				</div>
62 62
 				<div class="gv-view-types-hover">
63 63
 					<div>
64 64
 						<?php
65
-						if( $is_included ) {
65
+						if ( $is_included ) {
66 66
 						?>
67 67
 							<p><button class="button button-secondary button-hero <?php echo esc_attr( $button_class ); ?>" rel="internal" data-template-path="<?php echo esc_attr( $template_path ); ?>" data-templateid="<?php echo esc_attr( $template_id ); ?>" data-download-id="<?php echo esc_attr( $download_id ); ?>"><?php echo $button_text; ?></button></p>
68
-							<?php if( !empty( $template['license'] ) ) { ?>
69
-								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gk-gravityview' ), esc_html( str_replace( ' ', '&nbsp;', $template['license'] ) ) ); ?></p>
68
+							<?php if ( ! empty( $template[ 'license' ] ) ) { ?>
69
+								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gk-gravityview' ), esc_html( str_replace( ' ', '&nbsp;', $template[ 'license' ] ) ) ); ?></p>
70 70
 							<?php } ?>
71 71
 						<?php
72
-						} elseif( $placeholder ) {
73
-							$utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template['license'] ) . '&utm_content=' . urlencode( $template['slug'] );
72
+						} elseif ( $placeholder ) {
73
+							$utm_string = '?utm_source=plugin&utm_medium=buy_now&utm_campaign=view_type&utm_term=' . urlencode( $template[ 'license' ] ) . '&utm_content=' . urlencode( $template[ 'slug' ] );
74 74
 							?>
75
-							<p><a href="<?php echo esc_url( $template['buy_source'] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gk-gravityview'); ?></a></p>
75
+							<p><a href="<?php echo esc_url( $template[ 'buy_source' ] ); ?>" class="button button-primary button-hero" rel="noreferrer noopener external"><?php esc_html_e( 'Buy Now', 'gk-gravityview' ); ?></a></p>
76 76
 
77
-							<?php if( !empty( $template['preview'] ) ) { ?>
78
-								<p><a href="<?php echo esc_url( $template['preview'] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gk-gravityview'); ?>"></i> <?php esc_html_e( 'Try a demo', 'gk-gravityview' ); ?></a></p>
77
+							<?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
78
+								<p><a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="noreferrer noopener external" class="button button-secondary"><i class="dashicons dashicons-external" style="vertical-align: middle;" title="<?php esc_html_e( 'View a live demo of this layout', 'gk-gravityview' ); ?>"></i> <?php esc_html_e( 'Try a demo', 'gk-gravityview' ); ?></a></p>
79 79
 							<?php } ?>
80 80
 
81
-							<?php if( ! empty( $template['license'] ) ) { ?>
82
-								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gk-gravityview' ), '<a href="https://www.gravitykit.com/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', '&nbsp;', $template['license'] ) ) . '</a>' ); ?></p>
81
+							<?php if ( ! empty( $template[ 'license' ] ) ) { ?>
82
+								<p class="gv-included-in"><?php echo sprintf( esc_html__( 'This layout is included in the %s license.', 'gk-gravityview' ), '<a href="https://www.gravitykit.com/pricing/' . esc_attr( $utm_string ) . '" rel="noreferrer noopener external">' . esc_html( str_replace( ' ', '&nbsp;', $template[ 'license' ] ) ) . '</a>' ); ?></p>
83 83
 							<?php } ?>
84 84
 						<?php }
85 85
 
86
-						if ($placeholder || $is_included) { ?> </div><div class="hidden"> <?php } ?>
86
+						if ( $placeholder || $is_included ) { ?> </div><div class="hidden"> <?php } ?>
87 87
 
88
-                        <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gk-gravityview'); ?></a></p>
89
-                        <?php if( !empty( $template['preview'] ) ) { ?>
90
-                            <a href="<?php echo esc_url( $template['preview'] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-welcome-view-site" title="<?php esc_html_e( 'View a live demo of this preset', 'gk-gravityview'); ?>"></i></a>
88
+                        <p><a href="#gv_select_template" role="button" class="gv_select_template button button-hero button-primary" data-templateid="<?php echo esc_attr( $id ); ?>"><?php esc_html_e( 'Select', 'gk-gravityview' ); ?></a></p>
89
+                        <?php if ( ! empty( $template[ 'preview' ] ) ) { ?>
90
+                            <a href="<?php echo esc_url( $template[ 'preview' ] ); ?>" rel="external" class="gv-site-preview"><i class="dashicons dashicons-welcome-view-site" title="<?php esc_html_e( 'View a live demo of this preset', 'gk-gravityview' ); ?>"></i></a>
91 91
                         <?php } ?>
92 92
 					</div>
93 93
 				</div>
Please login to merge, or discard this patch.