← All changes
|
json-endpoints/jetpack/class.jetpack-json-api-themes-modify-endpoint.php
+8
-1
12.0.3
→
16.3-a.7
View file →
| @@ -1,10 +1,16 @@ | ||
| 1 | 1 | <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName |
| 2 | 2 | |
| 3 | +if ( ! defined( 'ABSPATH' ) ) { | |
| 4 | + exit( 0 ); | |
| 5 | +} | |
| 6 | + | |
| 3 | 7 | /** |
| 4 | 8 | * Themes modify endpoint class. |
| 5 | 9 | * POST /sites/%s/themes/%s |
| 6 | 10 | * POST /sites/%s/themes |
| 11 | + * | |
| 12 | + * @phan-constructor-used-for-side-effects | |
| 7 | 13 | */ |
| 8 | 14 | class Jetpack_JSON_API_Themes_Modify_Endpoint extends Jetpack_JSON_API_Themes_Endpoint { |
| 9 | 15 | |
| 10 | 16 | /** |
| @@ -99,8 +105,9 @@ | ||
| 99 | 105 | |
| 100 | 106 | // Clear the cache. |
| 101 | 107 | wp_update_themes(); |
| 102 | 108 | |
| 109 | + $result = null; | |
| 103 | 110 | foreach ( $this->themes as $theme ) { |
| 104 | 111 | /** |
| 105 | 112 | * Pre-upgrade action |
| 106 | 113 | * |
| @@ -141,8 +148,9 @@ | ||
| 141 | 148 | if ( ! isset( $available_themes_updates->translations ) || empty( $available_themes_updates->translations ) ) { |
| 142 | 149 | return new WP_Error( 'nothing_to_translate' ); |
| 143 | 150 | } |
| 144 | 151 | |
| 152 | + $result = null; | |
| 145 | 153 | foreach ( $available_themes_updates->translations as $translation ) { |
| 146 | 154 | $theme = $translation['slug']; |
| 147 | 155 | if ( ! in_array( $translation['slug'], $this->themes, true ) ) { |
| 148 | 156 | $this->log[ $theme ][] = __( 'No update needed', 'jetpack' ); |
| @@ -172,6 +180,5 @@ | ||
| 172 | 180 | } |
| 173 | 181 | |
| 174 | 182 | return true; |
| 175 | 183 | } |
| 176 | - | |
| 177 | 184 | } |