Completed
Push — develop ( 2d1f0b...2e2529 )
by Gennady
17:31
created
plugin-and-theme-hooks/class-gravityview-plugin-hooks-pageviews.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 
43 43
 		parent::add_hooks();
44 44
 
45
-		add_shortcode( 'gv_pageviews', array( $this, 'pageviews') );
45
+		add_shortcode( 'gv_pageviews', array( $this, 'pageviews' ) );
46 46
 
47 47
 		add_filter( 'gravityview/fields/custom/decode_shortcodes', array( $this, 'inject_entry_id' ), 10, 3 );
48 48
 
@@ -68,8 +68,8 @@  discard block
 block discarded – undo
68 68
 	 * Used as sort of an action via the gravityview/fields/custom/decode_shortcodes filter.
69 69
 	 */
70 70
 	public function inject_entry_id( $r, $content, $context ) {
71
-		if ( ! empty( $context->entry['id'] ) ) {
72
-			$this->next_id = $context->entry['id'];
71
+		if ( ! empty( $context->entry[ 'id' ] ) ) {
72
+			$this->next_id = $context->entry[ 'id' ];
73 73
 		} else {
74 74
 			$this->next_id = false; // Nothing to look at, move along
75 75
 		}
@@ -97,13 +97,13 @@  discard block
 block discarded – undo
97 97
 			'id'        => $this->next_id,
98 98
 		), $atts );
99 99
 
100
-		if ( ! $this->atts['id'] ) {
100
+		if ( ! $this->atts[ 'id' ] ) {
101 101
 			return; // The ID was not set
102 102
 		}
103 103
 
104 104
 		add_filter( 'pageviews_placeholder_preload', array( $this, 'preload_callback' ) );
105 105
 
106
-		$output = Pageviews::placeholder( 'GV' . $this->atts['id'] ); // Prefix the ID to avoid collissions with default post IDs
106
+		$output = Pageviews::placeholder( 'GV' . $this->atts[ 'id' ] ); // Prefix the ID to avoid collissions with default post IDs
107 107
 
108 108
 		remove_filter( 'pageviews_placeholder_preload', array( $this, 'preload_callback' ) );
109 109
 
@@ -114,7 +114,7 @@  discard block
 block discarded – undo
114 114
 	 * Set the preload text.
115 115
 	 */
116 116
 	public function preload_callback( $preload ) {
117
-		return $this->atts['preload'];
117
+		return $this->atts[ 'preload' ];
118 118
 	}
119 119
 
120 120
 	/**
@@ -122,7 +122,7 @@  discard block
 block discarded – undo
122 122
 	 */
123 123
 	public function increment_callback() {
124 124
 		if ( $entry = gravityview()->request->is_entry() ) {
125
-			$increment = 'GV' . $entry['id'];
125
+			$increment = 'GV' . $entry[ 'id' ];
126 126
 			?>
127 127
 				_pv_config.incr = <?php echo json_encode( $increment ); ?>;
128 128
 			<?php
Please login to merge, or discard this patch.