| @@ -1,14 +1,12 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | /** |
| 4 | - * E2pdf Extension Model | |
| 5 | - * | |
| 6 | - * @copyright Copyright 2017 https://e2pdf.com | |
| 7 | - * @license GPL v2 | |
| 8 | - * @version 1 | |
| 9 | - * @link https://e2pdf.com | |
| 10 | - * @since 0.00.01 | |
| 4 | + * File: /model/e2pdf-extension.php | |
| 5 | + * | |
| 6 | + * @package E2Pdf | |
| 7 | + * @license GPLv3 | |
| 8 | + * @link https://e2pdf.com | |
| 11 | 9 | */ |
| 12 | 10 | if (!defined('ABSPATH')) { |
| 13 | 11 | die('Access denied.'); |
| 14 | 12 | } |
| @@ -16,13 +14,12 @@ | ||
| 16 | 14 | class Model_E2pdf_Extension extends Model_E2pdf_Model { |
| 17 | 15 | |
| 18 | 16 | private $extension; |
| 19 | 17 | |
| 20 | - function __construct() { | |
| 21 | - parent::__construct(); | |
| 22 | - } | |
| 23 | - | |
| 24 | 18 | public function load($name) { |
| 19 | + if (in_array($name, get_option('e2pdf_disabled_extensions', []), true)) { | |
| 20 | + return false; | |
| 21 | + } | |
| 25 | 22 | $class = 'Extension_E2pdf_' . ucfirst($name); |
| 26 | 23 | if (class_exists($class)) { |
| 27 | 24 | $extension = new $class(); |
| 28 | 25 | if ($extension->active()) { |
| @@ -42,21 +39,51 @@ | ||
| 42 | 39 | } |
| 43 | 40 | return false; |
| 44 | 41 | } |
| 45 | 42 | |
| 43 | + public function info($attr = false) { | |
| 44 | + if ($this->extension() && method_exists($this->extension(), 'info')) { | |
| 45 | + return $this->extension()->info($attr); | |
| 46 | + } | |
| 47 | + return false; | |
| 48 | + } | |
| 49 | + | |
| 46 | 50 | public function extension() { |
| 47 | 51 | return $this->extension; |
| 48 | 52 | } |
| 49 | 53 | |
| 50 | 54 | public function set($attr, $value) { |
| 51 | - if (method_exists($this->extension(), 'set')) { | |
| 55 | + if ($this->extension() && method_exists($this->extension(), 'set')) { | |
| 52 | 56 | return $this->extension()->set($attr, $value); |
| 53 | 57 | } |
| 54 | 58 | return false; |
| 55 | 59 | } |
| 56 | 60 | |
| 61 | + public function patch($key = false, $value = false, $entry = null) { | |
| 62 | + if ($this->extension()) { | |
| 63 | + switch ($key) { | |
| 64 | + case 'args': | |
| 65 | + if (!empty($value)) { | |
| 66 | + $this->extension()->set($key, $value); | |
| 67 | + if ($entry) { | |
| 68 | + $entry->set_data($key, $this->extension()->get($key)); | |
| 69 | + } | |
| 70 | + } | |
| 71 | + break; | |
| 72 | + default: | |
| 73 | + if ($value !== false) { | |
| 74 | + $this->extension()->set($key, $value); | |
| 75 | + if ($entry) { | |
| 76 | + $entry->set_data($key, $this->extension()->get($key)); | |
| 77 | + } | |
| 78 | + } | |
| 79 | + break; | |
| 80 | + } | |
| 81 | + } | |
| 82 | + } | |
| 83 | + | |
| 57 | 84 | public function get($attr) { |
| 58 | - if (method_exists($this->extension(), 'get')) { | |
| 85 | + if ($this->extension() && method_exists($this->extension(), 'get')) { | |
| 59 | 86 | return $this->extension()->get($attr); |
| 60 | 87 | } |
| 61 | 88 | return false; |
| 62 | 89 | } |
| @@ -61,79 +88,173 @@ | ||
| 61 | 88 | return false; |
| 62 | 89 | } |
| 63 | 90 | |
| 64 | 91 | public function verify() { |
| 65 | - if (method_exists($this->extension(), 'verify')) { | |
| 92 | + if ($this->extension() && method_exists($this->extension(), 'verify')) { | |
| 66 | 93 | return $this->extension()->verify(); |
| 67 | 94 | } |
| 68 | 95 | return false; |
| 69 | 96 | } |
| 70 | 97 | |
| 71 | - public function import() { | |
| 72 | - if (method_exists($this->extension(), 'import')) { | |
| 73 | - return $this->extension()->import(); | |
| 98 | + public function import($xml, $options = []) { | |
| 99 | + if ($this->extension() && method_exists($this->extension(), 'import')) { | |
| 100 | + return $this->extension()->import($xml, $options); | |
| 74 | 101 | } |
| 75 | 102 | return false; |
| 76 | 103 | } |
| 77 | 104 | |
| 78 | - public function export() { | |
| 79 | - if (method_exists($this->extension(), 'export')) { | |
| 80 | - return $this->extension()->export(); | |
| 105 | + public function after_import($old_template_id, $new_template_id) { | |
| 106 | + if ($this->extension() && method_exists($this->extension(), 'after_import')) { | |
| 107 | + return $this->extension()->after_import($old_template_id, $new_template_id); | |
| 81 | 108 | } |
| 82 | 109 | return false; |
| 83 | 110 | } |
| 84 | 111 | |
| 85 | - public function backup() { | |
| 86 | - if (method_exists($this->extension(), 'backup')) { | |
| 87 | - return $this->extension()->backup(); | |
| 112 | + public function backup($xml = false) { | |
| 113 | + if ($this->extension() && method_exists($this->extension(), 'backup')) { | |
| 114 | + return $this->extension()->backup($xml); | |
| 88 | 115 | } |
| 89 | 116 | return false; |
| 90 | 117 | } |
| 91 | 118 | |
| 92 | - public function get_item($item_id = false) { | |
| 93 | - if (method_exists($this->extension(), 'get_item')) { | |
| 94 | - return $this->extension()->get_item($item_id); | |
| 119 | + public function item($item_id = false) { | |
| 120 | + if ($this->extension() && method_exists($this->extension(), 'item')) { | |
| 121 | + return $this->extension()->item($item_id); | |
| 95 | 122 | } |
| 96 | 123 | return false; |
| 97 | 124 | } |
| 98 | 125 | |
| 99 | - public function get_items() { | |
| 100 | - if (method_exists($this->extension(), 'get_items')) { | |
| 101 | - return $this->extension()->get_items(); | |
| 126 | + public function items() { | |
| 127 | + if ($this->extension() && method_exists($this->extension(), 'items')) { | |
| 128 | + return $this->extension()->items(); | |
| 102 | 129 | } |
| 103 | 130 | return false; |
| 104 | 131 | } |
| 105 | 132 | |
| 106 | - public function get_styles() { | |
| 107 | - if (method_exists($this->extension(), 'get_styles')) { | |
| 108 | - return $this->extension()->get_styles(); | |
| 133 | + // styles | |
| 134 | + public function styles($item = false) { | |
| 135 | + if ($this->extension() && method_exists($this->extension(), 'styles')) { | |
| 136 | + return $this->extension()->styles($item); | |
| 109 | 137 | } |
| 110 | 138 | return false; |
| 111 | 139 | } |
| 112 | 140 | |
| 113 | - public function render($value, $type = false, $field = array()) { | |
| 114 | - if (method_exists($this->extension(), 'render')) { | |
| 115 | - return $this->extension()->render($value, $type, $field); | |
| 141 | + // render | |
| 142 | + public function render($value, $field = [], $convert_shortcodes = true, $raw = false) { | |
| 143 | + if ($this->extension() && method_exists($this->extension(), 'render')) { | |
| 144 | + $filter = has_filter('e2pdf_pdf_render_filter'); | |
| 145 | + if (!$filter) { | |
| 146 | + $this->pre_render(); | |
| 147 | + } | |
| 148 | + $content = $this->extension()->render($value, $field, $convert_shortcodes, $raw); | |
| 149 | + if (!$filter) { | |
| 150 | + $this->after_render(); | |
| 151 | + } | |
| 152 | + $type = isset($field['type']) ? $field['type'] : false; | |
| 153 | + if ($type == 'e2pdf-image' || $type == 'e2pdf-signature' || $type == 'e2pdf-qrcode' || $type == 'e2pdf-barcode' || $type == 'e2pdf-graph') { | |
| 154 | + return $content; | |
| 155 | + } else { | |
| 156 | + return $this->helper->load('translator')->translate($content, 'full'); | |
| 157 | + } | |
| 116 | 158 | } |
| 159 | + return ''; | |
| 160 | + } | |
| 161 | + | |
| 162 | + // datasets | |
| 163 | + public function datasets($item = false, $name = false) { | |
| 164 | + if ($this->extension() && method_exists($this->extension(), 'datasets')) { | |
| 165 | + $filter = has_filter('e2pdf_pdf_render_filter'); | |
| 166 | + if (!$filter) { | |
| 167 | + $this->pre_render(); | |
| 168 | + } | |
| 169 | + $content = $this->extension()->datasets($item, $name); | |
| 170 | + if (!$filter) { | |
| 171 | + $this->after_render(); | |
| 172 | + } | |
| 173 | + return $content; | |
| 174 | + } | |
| 117 | 175 | return false; |
| 118 | 176 | } |
| 119 | 177 | |
| 120 | - public function get_datasets($item = false, $name = false) { | |
| 121 | - if (method_exists($this->extension(), 'get_datasets')) { | |
| 122 | - return $this->extension()->get_datasets($item, $name); | |
| 178 | + public function pre_render() { | |
| 179 | + add_filter('e2pdf_pdf_render_filter', [$this->helper, '__return_true'], 999); | |
| 180 | + add_filter('e2pdf_pdf_render', [$this->helper, '__return_true'], 999); | |
| 181 | + if (class_exists('ACF')) { | |
| 182 | + if (apply_filters('e2pdf_acf_enable_shortcodes', true)) { | |
| 183 | + add_filter('acf/settings/enable_shortcode', [$this->helper, '__return_true'], 999); | |
| 184 | + } | |
| 185 | + if (apply_filters('e2pdf_acf_allow_in_block_themes_outside_content', true)) { | |
| 186 | + add_filter('acf/shortcode/allow_in_block_themes_outside_content', [$this->helper, '__return_true'], 999); | |
| 187 | + } | |
| 188 | + if (apply_filters('e2pdf_acf_allow_in_bindings', false)) { | |
| 189 | + add_filter('acf/load_field', [$this, 'filter_acf_allow_in_bindings'], 999); | |
| 190 | + } | |
| 191 | + if (!apply_filters('e2pdf_prevent_access_to_fields_on_non_public_posts', true)) { | |
| 192 | + add_filter('acf/shortcode/prevent_access_to_fields_on_non_public_posts', [$this->helper, '__return_false'], 999); | |
| 193 | + } | |
| 194 | + add_filter('acf/load_value', [$this, 'filter_acf_load_value'], 999); | |
| 195 | + add_filter('do_shortcode_tag', [$this, 'filter_do_shortcode_tag_acf'], 999, 2); | |
| 123 | 196 | } |
| 197 | + add_filter('jet-engine/listings/data/default-object', [$this, 'filter_jet_listings_data_default_object'], 999); | |
| 198 | + } | |
| 199 | + | |
| 200 | + public function after_render() { | |
| 201 | + remove_filter('jet-engine/listings/data/default-object', [$this, 'filter_jet_listings_data_default_object'], 999); | |
| 202 | + if (class_exists('ACF')) { | |
| 203 | + if (apply_filters('e2pdf_acf_enable_shortcodes', true)) { | |
| 204 | + remove_filter('acf/settings/enable_shortcode', [$this->helper, '__return_true'], 999); | |
| 205 | + } | |
| 206 | + if (apply_filters('e2pdf_acf_allow_in_block_themes_outside_content', true)) { | |
| 207 | + remove_filter('acf/shortcode/allow_in_block_themes_outside_content', [$this->helper, '__return_true'], 999); | |
| 208 | + } | |
| 209 | + if (apply_filters('e2pdf_acf_allow_in_bindings', false)) { | |
| 210 | + remove_filter('acf/load_field', [$this, 'filter_acf_allow_in_bindings'], 999); | |
| 211 | + } | |
| 212 | + if (!apply_filters('e2pdf_prevent_access_to_fields_on_non_public_posts', true)) { | |
| 213 | + remove_filter('acf/shortcode/prevent_access_to_fields_on_non_public_posts', [$this->helper, '__return_false'], 999); | |
| 214 | + } | |
| 215 | + remove_filter('acf/load_value', [$this, 'filter_acf_load_value'], 999); | |
| 216 | + remove_filter('do_shortcode_tag', [$this, 'filter_do_shortcode_tag_acf'], 999); | |
| 217 | + } | |
| 218 | + remove_filter('e2pdf_pdf_render', [$this->helper, '__return_true'], 999); | |
| 219 | + remove_filter('e2pdf_pdf_render_filter', [$this->helper, '__return_true'], 999); | |
| 220 | + } | |
| 221 | + | |
| 222 | + // convert shortcodes | |
| 223 | + public function convert_shortcodes($value, $to = false, $html = false) { | |
| 224 | + if ($this->extension() && method_exists($this->extension(), 'convert_shortcodes')) { | |
| 225 | + return $this->extension()->convert_shortcodes($value, $to, $html); | |
| 226 | + } | |
| 124 | 227 | return false; |
| 125 | 228 | } |
| 126 | 229 | |
| 127 | - public function get_dataset($dataset_id = false) { | |
| 128 | - if (method_exists($this->extension(), 'get_dataset')) { | |
| 129 | - return $this->extension()->get_dataset($dataset_id); | |
| 230 | + // dataset actions | |
| 231 | + public function get_dataset_actions($dataset_id = false) { | |
| 232 | + if ($this->extension() && method_exists($this->extension(), 'get_dataset_actions')) { | |
| 233 | + return $this->extension()->get_dataset_actions($dataset_id); | |
| 130 | 234 | } |
| 131 | 235 | return false; |
| 132 | 236 | } |
| 133 | 237 | |
| 134 | - public function get_extensions_list() { | |
| 135 | - $list = array(); | |
| 238 | + // template actions | |
| 239 | + public function get_template_actions($template_id = false) { | |
| 240 | + if ($this->extension() && method_exists($this->extension(), 'get_template_actions')) { | |
| 241 | + return $this->extension()->get_template_actions($template_id); | |
| 242 | + } | |
| 243 | + return false; | |
| 244 | + } | |
| 245 | + | |
| 246 | + // storing engine | |
| 247 | + public function get_storing_engine() { | |
| 248 | + if ($this->extension() && method_exists($this->extension(), 'get_storing_engine')) { | |
| 249 | + return $this->extension()->get_storing_engine(); | |
| 250 | + } | |
| 251 | + return false; | |
| 252 | + } | |
| 253 | + | |
| 254 | + // extensions | |
| 255 | + public function extensions($load = true) { | |
| 256 | + $list = []; | |
| 136 | 257 | $extentions_path = $this->helper->get('plugin_dir') . 'classes/extension/*'; |
| 137 | 258 | foreach (array_filter(glob($extentions_path), 'is_file') as $file) { |
| 138 | 259 | $info = pathinfo($file); |
| 139 | 260 | $file_name = basename($file, '.' . $info['extension']); |
| @@ -138,82 +259,184 @@ | ||
| 138 | 259 | $info = pathinfo($file); |
| 139 | 260 | $file_name = basename($file, '.' . $info['extension']); |
| 140 | 261 | $file_name = substr($file_name, 6); |
| 141 | 262 | |
| 142 | - if ($this->load($file_name)) { | |
| 143 | - $list = array_merge($list, $this->extension->info()); | |
| 263 | + if ($load) { | |
| 264 | + if ($this->load($file_name)) { | |
| 265 | + $list = array_merge($list, $this->extension->info()); | |
| 266 | + } | |
| 267 | + } else { | |
| 268 | + $list[] = $file_name; | |
| 144 | 269 | } |
| 145 | 270 | } |
| 146 | - | |
| 147 | 271 | return $list; |
| 148 | 272 | } |
| 149 | 273 | |
| 274 | + // delete item | |
| 150 | 275 | public function delete_item($template_id = false, $dataset_id = false) { |
| 151 | - if (method_exists($this->extension(), 'delete_item')) { | |
| 276 | + if ($this->extension() && method_exists($this->extension(), 'delete_item')) { | |
| 152 | 277 | return $this->extension()->delete_item($template_id, $dataset_id); |
| 153 | 278 | } |
| 154 | 279 | return false; |
| 155 | 280 | } |
| 156 | 281 | |
| 282 | + // delete items | |
| 157 | 283 | public function delete_items($template_id = false) { |
| 158 | - if (method_exists($this->extension(), 'delete_items')) { | |
| 284 | + if ($this->extension() && method_exists($this->extension(), 'delete_items')) { | |
| 159 | 285 | return $this->extension()->delete_items($template_id); |
| 160 | 286 | } |
| 161 | 287 | return false; |
| 162 | 288 | } |
| 163 | 289 | |
| 164 | - /** | |
| 165 | - * Visual Mapper for Mapping field | |
| 166 | - * | |
| 167 | - * @return bool|string - Prepared form or false | |
| 168 | - */ | |
| 290 | + // visual mapper | |
| 169 | 291 | public function visual_mapper() { |
| 170 | - if (method_exists($this->extension(), 'visual_mapper')) { | |
| 171 | - return $this->extension()->visual_mapper(); | |
| 292 | + | |
| 293 | + if ($this->extension() && method_exists($this->extension(), 'visual_mapper')) { | |
| 294 | + if (!extension_loaded('libxml')) { | |
| 295 | + /* translators: %s: PHP Extension */ | |
| 296 | + return sprintf(__('The PHP %s extension is required', 'e2pdf'), 'libxml'); | |
| 297 | + } | |
| 298 | + if (!extension_loaded('Dom')) { | |
| 299 | + /* translators: %s: PHP Extension */ | |
| 300 | + return sprintf(__('The PHP %s extension is required', 'e2pdf'), 'DOM'); | |
| 301 | + } | |
| 302 | + if ($this->extension()->get('item') == '-2') { | |
| 303 | + $visual_mapper = ''; | |
| 304 | + if ($this->extension()->get('item1')) { | |
| 305 | + $this->extension()->set('item', $this->extension()->get('item1')); | |
| 306 | + | |
| 307 | + $output = $this->extension()->visual_mapper(); | |
| 308 | + if ($output !== false) { | |
| 309 | + $visual_mapper .= $output; | |
| 310 | + } | |
| 311 | + } | |
| 312 | + if ($this->extension()->get('item2')) { | |
| 313 | + $this->extension()->set('item', $this->extension()->get('item2')); | |
| 314 | + $output = $this->extension()->visual_mapper(); | |
| 315 | + if ($output !== false) { | |
| 316 | + $visual_mapper .= $output; | |
| 317 | + } | |
| 318 | + } | |
| 319 | + return $visual_mapper; | |
| 320 | + } else { | |
| 321 | + return $this->extension()->visual_mapper(); | |
| 322 | + } | |
| 172 | 323 | } |
| 173 | 324 | return false; |
| 174 | 325 | } |
| 175 | 326 | |
| 176 | - /** | |
| 177 | - * Convert Field name to Value | |
| 178 | - * @since 0.01.34 | |
| 179 | - * | |
| 180 | - * @param string $name - Field name | |
| 181 | - * | |
| 182 | - * @return bool|string - Converted value or false | |
| 183 | - */ | |
| 327 | + public function auto_form($template, $data = []) { | |
| 328 | + if ($this->extension() && method_exists($this->extension(), 'auto_form')) { | |
| 329 | + return $this->extension()->auto_form($template, $data); | |
| 330 | + } | |
| 331 | + return $template; | |
| 332 | + } | |
| 333 | + | |
| 334 | + // auto map | |
| 184 | 335 | public function auto_map($name = false) { |
| 185 | - if (method_exists($this->extension(), 'auto_map') && $name) { | |
| 336 | + if ($this->extension() && method_exists($this->extension(), 'auto_map') && $name) { | |
| 186 | 337 | return $this->extension()->auto_map($name); |
| 187 | 338 | } |
| 188 | 339 | return false; |
| 189 | 340 | } |
| 190 | 341 | |
| 342 | + // auto | |
| 191 | 343 | public function auto() { |
| 192 | - if (method_exists($this->extension(), 'auto')) { | |
| 193 | - return $this->extension()->auto(); | |
| 344 | + if ($this->extension() && method_exists($this->extension(), 'auto')) { | |
| 345 | + if ($this->extension()->get('item') == '-2') { | |
| 346 | + if (!$this->extension()->get('item1') && !$this->extension()->get('item2')) { | |
| 347 | + return false; | |
| 348 | + } | |
| 349 | + $data = []; | |
| 350 | + if ($this->extension()->get('item1')) { | |
| 351 | + $this->extension()->set('item', $this->extension()->get('item1')); | |
| 352 | + $data = $this->extension()->auto(); | |
| 353 | + } | |
| 354 | + if ($this->extension()->get('item2')) { | |
| 355 | + $this->extension()->set('item', $this->extension()->get('item2')); | |
| 356 | + | |
| 357 | + if (!empty($data)) { | |
| 358 | + | |
| 359 | + $data2 = $this->extension()->auto(); | |
| 360 | + $data['elements'] = array_merge($data['elements'], $data2['elements']); | |
| 361 | + } else { | |
| 362 | + $data = $this->extension()->auto(); | |
| 363 | + } | |
| 364 | + } | |
| 365 | + return $data; | |
| 366 | + } else { | |
| 367 | + return $this->extension()->auto(); | |
| 368 | + } | |
| 194 | 369 | } |
| 195 | 370 | return false; |
| 196 | 371 | } |
| 197 | 372 | |
| 373 | + // method | |
| 374 | + public function method($attr = false) { | |
| 375 | + if ($attr && $this->extension() && method_exists($this->extension(), $attr)) { | |
| 376 | + return true; | |
| 377 | + } | |
| 378 | + return false; | |
| 379 | + } | |
| 380 | + | |
| 381 | + // load actions | |
| 198 | 382 | public function load_actions() { |
| 199 | - if (method_exists($this->extension(), 'load_actions')) { | |
| 383 | + if ($this->extension() && method_exists($this->extension(), 'load_actions')) { | |
| 200 | 384 | return $this->extension()->load_actions(); |
| 201 | 385 | } |
| 202 | 386 | return false; |
| 203 | 387 | } |
| 204 | 388 | |
| 389 | + // load filters | |
| 205 | 390 | public function load_filters() { |
| 206 | - if (method_exists($this->extension(), 'load_filters')) { | |
| 391 | + if ($this->extension() && method_exists($this->extension(), 'load_filters')) { | |
| 207 | 392 | return $this->extension()->load_filters(); |
| 208 | 393 | } |
| 209 | 394 | return false; |
| 210 | 395 | } |
| 211 | 396 | |
| 397 | + // load shortcodes | |
| 212 | 398 | public function load_shortcodes() { |
| 213 | - if (method_exists($this->extension(), 'load_shortcodes')) { | |
| 399 | + if ($this->extension() && method_exists($this->extension(), 'load_shortcodes')) { | |
| 214 | 400 | return $this->extension()->load_shortcodes(); |
| 215 | 401 | } |
| 216 | 402 | return false; |
| 217 | 403 | } |
| 218 | 404 | |
| 405 | + // filter acf allow in bidnings | |
| 406 | + public function filter_acf_allow_in_bindings($field) { | |
| 407 | + if (isset($field['allow_in_bindings']) && !$field['allow_in_bindings']) { | |
| 408 | + $field['allow_in_bindings'] = 1; | |
| 409 | + } | |
| 410 | + return $field; | |
| 411 | + } | |
| 412 | + | |
| 413 | + // filter acf load value | |
| 414 | + public function filter_acf_load_value($output) { | |
| 415 | + if (is_array($output)) { | |
| 416 | + foreach ($output as $key => $value) { | |
| 417 | + if (is_string($value)) { | |
| 418 | + $output[$key] = $this->helper->load('translator')->translate($value, 'partial'); | |
| 419 | + } | |
| 420 | + } | |
| 421 | + } | |
| 422 | + return $output; | |
| 423 | + } | |
| 424 | + | |
| 425 | + // filter do shortcode tag acf | |
| 426 | + public function filter_do_shortcode_tag_acf($output, $tag) { | |
| 427 | + if ($tag === 'acf') { | |
| 428 | + return $this->helper->load('translator')->translate($output, 'partial'); | |
| 429 | + } | |
| 430 | + return $output; | |
| 431 | + } | |
| 432 | + | |
| 433 | + // filter jet engine default object | |
| 434 | + public function filter_jet_listings_data_default_object($default_object) { | |
| 435 | + if ($this->extension instanceof Extension_E2pdf_Wordpress || $this->extension instanceof Extension_E2pdf_Woocommerce) { | |
| 436 | + if ($this->get('item') != '-3' && $this->get('dataset')) { | |
| 437 | + $default_object = get_post($this->get('dataset')); | |
| 438 | + } | |
| 439 | + } | |
| 440 | + return $default_object; | |
| 441 | + } | |
| 219 | 442 | } |