PluginProbe
Assistant – Every Day Productivity Apps / 1.5.1
Assistant – Every Day Productivity Apps v1.5.1
1.5.5 trunk 0.1.0 0.2.0 0.2.1 0.2.2 0.3.0 0.3.1 0.4 0.4.1 0.4.2 0.5.0 0.5.1 0.6.0 0.7.0 0.7.0.2 0.7.0.3 0.7.0.4 0.7.0.5 0.7.0.6 0.7.0.7 0.7.0.8 0.7.0.9 0.7.1 1.0 All 71 releases
assistant / backend / src / Data / Transformers / ThemeUpdatesTransformer.php

ThemeUpdatesTransformer.php in Assistant – Every Day Productivity Apps 1.5.1, at backend/src/Data/Transformers/ThemeUpdatesTransformer.php

37 lines 1.0 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
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 }
37