PluginProbe
Jetpack – WP Security, Backup, Speed, & Growth / 16.3-beta
Jetpack – WP Security, Backup, Speed, & Growth v16.3-beta
16.3-beta 16.3-a.5 16.3-a.7 16.3-a.3 16.3-a.1 16.2 16.2-beta 12.0.3 12.1.3 12.2.3 12.3.2 12.4.2 12.5.2 12.6.4 12.7.3 12.8.3 12.9.5 13.0.2 13.1.5 13.2.4 13.3.3 13.4.5 13.5.2 13.6.2 13.7.2 All 507 releases
← All changes | modules/tiled-gallery/tiled-gallery/tiled-gallery-layout.php +18 -4 12.2.3 → 16.3-beta View file →
@@ -1,6 +1,10 @@
1 1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 2
3 +if ( ! defined( 'ABSPATH' ) ) {
4 + exit( 0 );
5 +}
6 +
3 7 /**
4 8 * Tiled gallery layout class.
5 9 */
6 10 abstract class Jetpack_Tiled_Gallery_Layout {
@@ -53,8 +57,15 @@
53 57 */
54 58 public $columns;
55 59
56 60 /**
61 + * Attachment link
62 + *
63 + * @var bool
64 + */
65 + public $needs_attachment_link;
66 +
67 + /**
57 68 * Constructor function.
58 69 *
59 70 * @param object $attachments - the attachmed image.
60 71 * @param string $link - the attachment link.
@@ -98,12 +109,14 @@
98 109
99 110 /**
100 111 * Handle tiled gallery template path.
101 112 *
113 + * @html-template-var array $context
114 + *
102 115 * @param string $name Template name.
103 116 * @param array $context Context array passed to the template.
104 117 */
105 - private function template( $name, $context = null ) {
118 + private function template( $name, $context = array() ) {
106 119 if ( ! in_array( $name, self::$templates, true ) ) {
107 120 return;
108 121 }
109 122
@@ -122,12 +135,14 @@
122 135
123 136 /**
124 137 * Handle tiled gallery partial path.
125 138 *
139 + * @html-template-var array $context
140 + *
126 141 * @param string $name - the name.
127 142 * @param array $context Context array passed to the partial.
128 143 */
129 - private function partial( $name, $context = null ) {
144 + private function partial( $name, $context = array() ) {
130 145 if ( ! in_array( $name, self::$partials, true ) ) {
131 146 return;
132 147 }
133 148
@@ -160,9 +175,9 @@
160 175
161 176 if ( class_exists( 'Jetpack_Carousel' ) || in_array( 'carousel', Jetpack::get_active_modules(), true ) || 'carousel' === $this->link ) {
162 177 $extra_data = array(
163 178 'blog_id' => $blog_id,
164 - 'permalink' => get_permalink( isset( $post->ID ) ? $post->ID : 0 ),
179 + 'permalink' => get_permalink( $post->ID ?? 0 ),
165 180 'likes_blog_id' => $likes_blog_id,
166 181 );
167 182 } else {
168 183 $extra_data = null;
@@ -170,5 +185,4 @@
170 185
171 186 return $extra_data;
172 187 }
173 188 }
174 -