| @@ -23,31 +23,8 @@ | ||
| 23 | 23 | Utils::TESTIMONIAL_WIDGET => $this->get_testimonial_widget_data( $assets_data ), |
| 24 | 24 | ]; |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | - public function get_v4_promotions_data( $force_request = false ): array { | |
| 28 | - $assets_data = $this->editor_assets_api->get_assets_data( $force_request ); | |
| 29 | - | |
| 30 | - if ( empty( $assets_data ) ) { | |
| 31 | - return []; | |
| 32 | - } | |
| 33 | - | |
| 34 | - $promotions = []; | |
| 35 | - | |
| 36 | - foreach ( $assets_data as $item ) { | |
| 37 | - foreach ( $item as $key => $promotion ) { | |
| 38 | - $promotions[ $key ] = [ | |
| 39 | - 'title' => esc_html( $promotion['title'] ?? '' ), | |
| 40 | - 'content' => esc_html( $promotion['content'] ?? '' ), | |
| 41 | - 'ctaUrl' => esc_url( $promotion['ctaUrl'] ?? '' ), | |
| 42 | - 'image' => esc_url( $promotion['image'] ?? '' ), | |
| 43 | - ]; | |
| 44 | - } | |
| 45 | - } | |
| 46 | - | |
| 47 | - return $promotions; | |
| 48 | - } | |
| 49 | - | |
| 50 | 27 | private function transform_assets_data( $force_request = false ) { |
| 51 | 28 | $assets_data = $this->editor_assets_api->get_assets_data( $force_request ); |
| 52 | 29 | $transformed_data = []; |
| 53 | 30 | |