Conditions | 3 |
Paths | 2 |
Total Lines | 25 |
Code Lines | 16 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 1 | Features | 0 |
1 | <?php |
||
22 | public static function checkPlugin() |
||
23 | { |
||
24 | $pluginActive = class_exists('\\Flynt\\Render'); |
||
25 | |||
26 | if (!$pluginActive) { |
||
27 | add_action('admin_notices', function () { |
||
28 | echo '<div class="error"><p>Flynt Core Plugin not activated. Make sure you activate the plugin in <a href="' |
||
29 | . esc_url(admin_url('plugins.php#flynt')) . '">' |
||
30 | . esc_url(admin_url('plugins.php')) . '</a></p></div>'; |
||
31 | }); |
||
32 | |||
33 | add_filter('template_include', function () { |
||
34 | $newTemplate = locate_template(['plugin-inactive.php']); |
||
35 | if ('' != $newTemplate) { |
||
36 | return $newTemplate; |
||
37 | } else { |
||
38 | return 'Flynt Core Plugin not activated! Please <a href="' |
||
39 | . esc_url(admin_url('plugins.php')) |
||
40 | . '">activate the plugin</a> and reload the page.'; |
||
41 | } |
||
42 | }); |
||
43 | } |
||
44 | |||
45 | return $pluginActive; |
||
46 | } |
||
47 | } |
||
48 |