| @@ -59,17 +59,15 @@ | ||
| 59 | 59 | |
| 60 | 60 | private static function pass_data_to_js(string $handle) { |
| 61 | 61 | $data = [ |
| 62 | 62 | 'plugin_url' => TABLEBERG_URL, |
| 63 | + // Pro marks this true only after its licence check succeeds and | |
| 64 | + // its runtime extensions actually boot. The version constant only | |
| 65 | + // proves that the add-on PHP file was loaded. | |
| 66 | + 'IS_PRO' => (bool) apply_filters( | |
| 67 | + 'tableberg/is_pro_runtime_active', | |
| 68 | + false | |
| 69 | + ), | |
| 63 | 70 | ]; |
| 64 | - $has_pro_addon = defined('TABLEBERG_PRO_VERSION'); | |
| 65 | - global $tp_fs; | |
| 66 | - if (isset($tp_fs)) { | |
| 67 | - $data['IS_PRO'] = $has_pro_addon | |
| 68 | - || ($tp_fs->is__premium_only() | |
| 69 | - && $tp_fs->can_use_premium_code()); | |
| 70 | - } else { | |
| 71 | - $data['IS_PRO'] = $has_pro_addon; | |
| 72 | - } | |
| 73 | 71 | wp_localize_script($handle, 'TABLEBERG_CFG', $data); |
| 74 | 72 | } |
| 75 | 73 | } |