| @@ -9,13 +9,8 @@ | ||
| 9 | 9 | * Singleton |
| 10 | 10 | */ |
| 11 | 11 | use SingletonTrait; |
| 12 | 12 | |
| 13 | - /** | |
| 14 | - * @var array | |
| 15 | - */ | |
| 16 | - private static $cache = []; | |
| 17 | - | |
| 18 | 13 | /*** |
| 19 | 14 | * Elementor Data key |
| 20 | 15 | */ |
| 21 | 16 | private const ELEMENTOR_DATA_KEY = '_elementor_data'; |
| @@ -42,12 +37,8 @@ | ||
| 42 | 37 | * |
| 43 | 38 | * @return array |
| 44 | 39 | */ |
| 45 | 40 | public function get_widget_data( string $widget_name, ?array $data = null, ?int $post_id = null ): array { |
| 46 | - $cache_key = 'get_widget_data_' . $widget_name . '_' . $post_id; | |
| 47 | - if ( isset( self::$cache[ $cache_key ] ) ) { | |
| 48 | - return self::$cache[ $cache_key ]; | |
| 49 | - } | |
| 50 | 41 | if ( ! $data && $post_id ) { |
| 51 | 42 | $data = $this->get_elementor_data( $post_id ); |
| 52 | 43 | } |
| 53 | 44 | |
| @@ -55,9 +46,9 @@ | ||
| 55 | 46 | return []; |
| 56 | 47 | } |
| 57 | 48 | |
| 58 | 49 | $this->search_el( $data, $widget_name ); |
| 59 | - self::$cache[ $cache_key ] = $this->eldata; | |
| 50 | + | |
| 60 | 51 | return $this->eldata; |
| 61 | 52 | } |
| 62 | 53 | |
| 63 | 54 | /*** |
| @@ -74,9 +65,9 @@ | ||
| 74 | 65 | |
| 75 | 66 | if ( ! empty( $value['elements'] ) && is_array( $value['elements'] ) ) { |
| 76 | 67 | $this->search_el( $value['elements'], $name ); |
| 77 | 68 | } else { |
| 78 | - if ( 'widget' === $value['elType'] && $value['widgetType'] === $name ) { | |
| 69 | + if ( $value['elType'] === 'widget' && $value['widgetType'] === $name ) { | |
| 79 | 70 | $this->eldata[] = $value; |
| 80 | 71 | } |
| 81 | 72 | } |
| 82 | 73 | } |