-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathplugin.php
More file actions
51 lines (42 loc) · 1.34 KB
/
Copy pathplugin.php
File metadata and controls
51 lines (42 loc) · 1.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
<?php
/**
* Plugin Name: Page for custom post type
* Plugin URI: https://github.com/nlemoine/page-for-custom-post-type
* Description: Allows you to set pages for any custom post type archive
* x-release-please-start-version
* Version: 1.1.0
* x-release-please-end
* Author: Nicolas Lemoine
* Author URI: https://n5s.dev/
* Requires at least: 6.0
* Tested up to: 6.7
* Requires PHP: 8.2
* License: GPL-3.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
* Text Domain: pfcpt
* Domain Path: /languages
*/
declare(strict_types=1);
namespace n5s\PageForCustomPostType;
// Prevent direct access
if (!\defined('ABSPATH')) {
exit;
}
// @bundle-autoload
// Load translations on init (plugin is not on wordpress.org, so the
// auto-loading introduced in WP 4.6 doesn't apply).
add_action('init', static function (): void {
load_plugin_textdomain('pfcpt', false, basename(__DIR__) . '/languages');
});
// Initialize plugin (hook before Polylang)
add_action('plugins_loaded', static function (): void {
$plugin = Plugin::getInstance();
$plugin->init();
$container = $plugin->getContainer();
foreach ($plugin->getIntegrations() as $integrationClass) {
$integration = $container->get($integrationClass);
if ($integration->isSupported()) {
$integration->registerHooks();
}
}
}, 0);