← All changes
|
json-endpoints/jetpack/class.jetpack-json-api-themes-endpoint.php
+5
-1
13.0.2
→
16.3-a.7
View file →
| @@ -1,8 +1,12 @@ | ||
| 1 | 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | 2 | |
| 3 | 3 | use Automattic\Jetpack\Image_CDN\Image_CDN_Core; |
| 4 | 4 | |
| 5 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 6 | + exit( 0 ); | |
| 7 | +} | |
| 8 | + | |
| 5 | 9 | /** |
| 6 | 10 | * Base class for working with themes, has useful helper functions. |
| 7 | 11 | */ |
| 8 | 12 | abstract class Jetpack_JSON_API_Themes_Endpoint extends Jetpack_JSON_API_Endpoint { |
| @@ -150,9 +154,9 @@ | ||
| 150 | 154 | $formatted_theme[ $key ] = $theme->get( $field ); |
| 151 | 155 | } |
| 152 | 156 | |
| 153 | 157 | $update_themes = get_site_transient( 'update_themes' ); |
| 154 | - $formatted_theme['update'] = ( isset( $update_themes->response[ $id ] ) ) ? $update_themes->response[ $id ] : null; | |
| 158 | + $formatted_theme['update'] = $update_themes->response[ $id ] ?? null; | |
| 155 | 159 | |
| 156 | 160 | $autoupdate = in_array( $id, Jetpack_Options::get_option( 'autoupdate_themes', array() ), true ); |
| 157 | 161 | $formatted_theme['autoupdate'] = $autoupdate; |
| 158 | 162 | |