| @@ -6,10 +6,8 @@ | ||
| 6 | 6 | use Templately\Builder\Source; |
| 7 | 7 | |
| 8 | 8 | class TemplateFactory { |
| 9 | 9 | protected $platform; |
| 10 | - | |
| 11 | - protected $template; | |
| 12 | 10 | protected $template_manager; |
| 13 | 11 | |
| 14 | 12 | public function __construct( $platform = 'elementor' ) { |
| 15 | 13 | $this->platform = $platform; |
| @@ -17,9 +15,9 @@ | ||
| 17 | 15 | } |
| 18 | 16 | |
| 19 | 17 | public function create( $type, $data, $meta = [] ) { |
| 20 | 18 | $data = wp_parse_args( $data ); |
| 21 | - | |
| 19 | + | |
| 22 | 20 | $meta = wp_parse_args( $meta, [ |
| 23 | 21 | Source::PLATFORM_META_KEY => $this->platform, |
| 24 | 22 | Source::TYPE_META_KEY => $type, |
| 25 | 23 | ] ); |
| @@ -29,6 +27,5 @@ | ||
| 29 | 27 | } |
| 30 | 28 | |
| 31 | 29 | return $this->template_manager->create( $type, $data, $meta ); |
| 32 | 30 | } |
| 33 | - | |
| 34 | -} | |
| 31 | +} | |