-
Notifications
You must be signed in to change notification settings - Fork 7
/
plugin.php
53 lines (45 loc) · 992 Bytes
/
plugin.php
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
52
53
<?php
/**
* Plugin initialization.
*
* @package CPTArchives
* @since 3.0.0
* @link https://github.com/cedaro/cpt-archives
* @copyright Copyright (c) 2015 Cedaro, LLC
* @license GPL-2.0+
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit;
use Cedaro\CPTArchives\Plugin;
use Cedaro\CPTArchives\PostType\ArchiveHookProvider;
/**
* Load the autoloader.
*
* @since 3.0.0
*/
require( __DIR__ . '/autoload.php' );
/**
* Retrieve the main plugin instance.
*
* @since 3.0.1
*
* @return Plugin
*/
function cptarchives() {
global $cptarchives;
if ( null === $cptarchives ) {
$cptarchives = new Plugin();
}
return $cptarchives;
}
cptarchives()->set_plugin_file( __DIR__ . '/cpt-archives.php' )
->set_archive_class( '\Cedaro\CPTArchives\PostType\Archive' );
/**
* Load the plugin.
*
* @since 3.0.0
*/
add_action( 'plugins_loaded', function() {
cptarchives()->register_hooks( new ArchiveHookProvider );
cptarchives()->load();
} );