← All changes
|
modules/tiled-gallery/tiled-gallery/tiled-gallery-layout.php
+11
-3
12.7.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 { |
| @@ -105,12 +109,14 @@ | ||
| 105 | 109 | |
| 106 | 110 | /** |
| 107 | 111 | * Handle tiled gallery template path. |
| 108 | 112 | * |
| 113 | + * @html-template-var array $context | |
| 114 | + * | |
| 109 | 115 | * @param string $name Template name. |
| 110 | 116 | * @param array $context Context array passed to the template. |
| 111 | 117 | */ |
| 112 | - private function template( $name, $context = null ) { | |
| 118 | + private function template( $name, $context = array() ) { | |
| 113 | 119 | if ( ! in_array( $name, self::$templates, true ) ) { |
| 114 | 120 | return; |
| 115 | 121 | } |
| 116 | 122 | |
| @@ -129,12 +135,14 @@ | ||
| 129 | 135 | |
| 130 | 136 | /** |
| 131 | 137 | * Handle tiled gallery partial path. |
| 132 | 138 | * |
| 139 | + * @html-template-var array $context | |
| 140 | + * | |
| 133 | 141 | * @param string $name - the name. |
| 134 | 142 | * @param array $context Context array passed to the partial. |
| 135 | 143 | */ |
| 136 | - private function partial( $name, $context = null ) { | |
| 144 | + private function partial( $name, $context = array() ) { | |
| 137 | 145 | if ( ! in_array( $name, self::$partials, true ) ) { |
| 138 | 146 | return; |
| 139 | 147 | } |
| 140 | 148 | |
| @@ -167,9 +175,9 @@ | ||
| 167 | 175 | |
| 168 | 176 | if ( class_exists( 'Jetpack_Carousel' ) || in_array( 'carousel', Jetpack::get_active_modules(), true ) || 'carousel' === $this->link ) { |
| 169 | 177 | $extra_data = array( |
| 170 | 178 | 'blog_id' => $blog_id, |
| 171 | - 'permalink' => get_permalink( isset( $post->ID ) ? $post->ID : 0 ), | |
| 179 | + 'permalink' => get_permalink( $post->ID ?? 0 ), | |
| 172 | 180 | 'likes_blog_id' => $likes_blog_id, |
| 173 | 181 | ); |
| 174 | 182 | } else { |
| 175 | 183 | $extra_data = null; |