golden hour
/home/godaofbq/dev.hyperredbed.com/wp-content/plugins/emailkit-pro/includes/Admin
⬆️ Go Up
Upload
File/Folder
Size
Actions
Api
-
Del
OK
Base.php
4.13 KB
Del
OK
Emails
-
Del
OK
Helpers
-
Del
OK
Hooks
-
Del
OK
License
-
Del
OK
TemplateManager.php
1.55 KB
Del
OK
Edit: TemplateManager.php
<?php namespace EmailKitPro\Admin; use EmailKit\Admin\Emails\EmailLists; use EmailKit\Admin\TemplateList; class TemplateManager{ public $pro_template = []; public function __construct() { $this->pro_template = $this->getProTemplate(); add_filter('emailkit/editor/templates', [$this, 'filter_pro_template']); } function filter_pro_template($template_list){ $mail_type = isset($_REQUEST['data']) ? sanitize_text_field($_REQUEST['data']) : ''; foreach ($template_list as $key => $template) { if( $template['package'] == 'pro' && isset($this->pro_template[$key]) && $template['mail_type'] == $mail_type ){ $template_list[$key]['file'] = $this->pro_template[$key]['file']; } } return $template_list; } function getProTemplate(){ return [ // TODO add more pro templates in the list // Sample here // 'template-100' => [ // 'id' => 100, // 'package' => 'pro', // 'mail_type' => 'woocommerce', // 'title' => EmailLists::PARTIAL_REFUND, // 'preview-thumb' => TemplateList::EMAILKIT_URL_TEMAPLTE_URL . 'templates/partial-refund/1/preview-thumb.svg', // 'demo-url' => 'https://wpmet.com/', // 'file' => EMAILKITPRO_DIR . 'includes/partial-refund/1/content.json', // ], ]; } }
Save