Skip to content

Commit 25a9b6f

Browse files
committed
(fix): autoloader
1 parent cd08c9d commit 25a9b6f

1 file changed

Lines changed: 13 additions & 11 deletions

File tree

pdc-faq.php

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,13 @@
3434
/**
3535
* Manual loaded file: the autoloader.
3636
*/
37-
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
38-
require_once __DIR__ . '/vendor/autoload.php';
39-
} else {
40-
require_once __DIR__ . '/autoloader.php';
41-
$autoloader = new Autoloader();
37+
if (!class_exists(\OWC\PDC\FAQ\Foundation\Plugin::class)) {
38+
if (file_exists(__DIR__ . '/vendor/autoload.php')) {
39+
require_once __DIR__ . '/vendor/autoload.php';
40+
} else {
41+
require_once __DIR__ . '/autoloader.php';
42+
$autoloader = new Autoloader();
43+
}
4244
}
4345

4446
/**
@@ -52,9 +54,9 @@
5254
if (! class_exists('OWC\PDC\Base\Foundation\Plugin')) {
5355
add_action('admin_notices', function () {
5456
$list = '<p>' . __(
55-
'The following plugins are required to use the PDC FAQ:',
56-
'pdc-faq'
57-
) . '</p><ol><li>OpenPDC Base (version >= 3.0.0)</li></ol>';
57+
'The following plugins are required to use the PDC FAQ:',
58+
'pdc-faq'
59+
) . '</p><ol><li>OpenPDC Base (version >= 3.0.0)</li></ol>';
5860

5961
printf('<div class="notice notice-error"><p>%s</p></div>', $list);
6062
});
@@ -64,9 +66,9 @@
6466
return;
6567
}
6668

67-
add_action('after_setup_theme', function () {
68-
(new Plugin(__DIR__))->boot();
69-
});
69+
add_action('after_setup_theme', function () {
70+
(new Plugin(__DIR__))->boot();
71+
});
7072
}, 10);
7173

7274

0 commit comments

Comments
 (0)