← All changes
|
backend/src/Data/Transformers/ThemeUpdatesTransformer.php
+36
-36
1.5.5
→
1.5.5.1
View file →
| @@ -1,36 +1,36 @@ | ||
| 1 | -<?php | |
| 2 | - | |
| 3 | - | |
| 4 | -namespace FL\Assistant\Data\Transformers; | |
| 5 | - | |
| 6 | - | |
| 7 | -class ThemeUpdatesTransformer { | |
| 8 | - | |
| 9 | - public function __invoke( \WP_Theme $theme ) { | |
| 10 | - | |
| 11 | - $update = $theme->update; | |
| 12 | - | |
| 13 | - $thumbnail = null; | |
| 14 | - if ( isset( $update->icons ) ) { | |
| 15 | - if ( isset( $update->icons['2x'] ) ) { | |
| 16 | - $thumbnail = $update->icons['2x']; | |
| 17 | - } elseif ( isset( $update->icons['1x'] ) ) { | |
| 18 | - $thumbnail = $update->icons['1x']; | |
| 19 | - } | |
| 20 | - } | |
| 21 | - return [ | |
| 22 | - 'author' => strip_tags( $theme->Author ), | |
| 23 | - 'banner' => $theme->get_screenshot(), | |
| 24 | - 'content' => $theme->Description, | |
| 25 | - 'id' => $update['theme'], | |
| 26 | - 'meta' => $theme->Version . ' by ' . strip_tags( $theme->Author ), | |
| 27 | - 'meta_updated' => $update['new_version'] . ' by ' . strip_tags( $theme->Author ), | |
| 28 | - 'theme' => $update['theme'], | |
| 29 | - 'thumbnail' => $theme->get_screenshot(), | |
| 30 | - 'title' => $theme->Name, | |
| 31 | - 'type' => 'theme', | |
| 32 | - 'version' => $theme->Version, | |
| 33 | - 'updatedVersion' => $update['new_version'], | |
| 34 | - ]; | |
| 35 | - } | |
| 36 | -} | |
| 1 | +<?php | |
| 2 | + | |
| 3 | + | |
| 4 | +namespace FL\Assistant\Data\Transformers; | |
| 5 | + | |
| 6 | + | |
| 7 | +class ThemeUpdatesTransformer { | |
| 8 | + | |
| 9 | + public function __invoke( \WP_Theme $theme ) { | |
| 10 | + | |
| 11 | + $update = $theme->update; | |
| 12 | + | |
| 13 | + $thumbnail = null; | |
| 14 | + if ( isset( $update->icons ) ) { | |
| 15 | + if ( isset( $update->icons['2x'] ) ) { | |
| 16 | + $thumbnail = $update->icons['2x']; | |
| 17 | + } elseif ( isset( $update->icons['1x'] ) ) { | |
| 18 | + $thumbnail = $update->icons['1x']; | |
| 19 | + } | |
| 20 | + } | |
| 21 | + return [ | |
| 22 | + 'author' => strip_tags( $theme->Author ), | |
| 23 | + 'banner' => $theme->get_screenshot(), | |
| 24 | + 'content' => $theme->Description, | |
| 25 | + 'id' => $update['theme'], | |
| 26 | + 'meta' => $theme->Version . ' by ' . strip_tags( $theme->Author ), | |
| 27 | + 'meta_updated' => $update['new_version'] . ' by ' . strip_tags( $theme->Author ), | |
| 28 | + 'theme' => $update['theme'], | |
| 29 | + 'thumbnail' => $theme->get_screenshot(), | |
| 30 | + 'title' => $theme->Name, | |
| 31 | + 'type' => 'theme', | |
| 32 | + 'version' => $theme->Version, | |
| 33 | + 'updatedVersion' => $update['new_version'], | |
| 34 | + ]; | |
| 35 | + } | |
| 36 | +} | |