-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgatherpress-org-plugin.php
More file actions
55 lines (50 loc) · 1.89 KB
/
Copy pathgatherpress-org-plugin.php
File metadata and controls
55 lines (50 loc) · 1.89 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
52
53
54
55
<?php
/**
* Plugin Name: GatherPress Org
* Plugin URI: https://gatherpress.org/
* Description: Site-specific functionality for gatherpress.org, including the Releases post type and taxonomy.
* Author: The GatherPress Community
* Author URI: https://gatherpress.org/
* Version: 1.0.0
* Requires PHP: 7.4
* Text Domain: gatherpress-org-plugin
* Domain Path: /languages
* License: GNU General Public License v2.0 or later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
*
* @package GatherPress_Org_Plugin
*/
// Exit if accessed directly.
defined( 'ABSPATH' ) || exit; // @codeCoverageIgnore
// Constants.
define( 'GATHERPRESS_ORG_PLUGIN_VERSION', current( get_file_data( __FILE__, array( 'Version' ), 'plugin' ) ) );
define( 'GATHERPRESS_ORG_PLUGIN_CORE_PATH', __DIR__ );
/**
* Adds the GatherPress_Org_Plugin namespace to the autoloader.
*
* This function hooks into the 'gatherpress_autoloader' filter and adds the
* GatherPress_Org_Plugin namespace to the list of namespaces with its core path.
*
* @param array $namespace An associative array of namespaces and their paths.
* @return array Modified array of namespaces and their paths.
*/
function gatherpress_org_plugin_autoloader( array $namespace ): array {
$namespace['GatherPress_Org_Plugin'] = GATHERPRESS_ORG_PLUGIN_CORE_PATH;
return $namespace;
}
add_filter( 'gatherpress_autoloader', 'gatherpress_org_plugin_autoloader' );
/**
* Initializes the GatherPress Org Plugin setup.
*
* This function hooks into the 'plugins_loaded' action to ensure that
* the GatherPress_Org_Plugin\Setup instance is created once all plugins are loaded,
* only if the GatherPress plugin is active.
*
* @return void
*/
function gatherpress_org_plugin_setup(): void {
if ( defined( 'GATHERPRESS_VERSION' ) ) {
GatherPress_Org_Plugin\Setup::get_instance();
}
}
add_action( 'plugins_loaded', 'gatherpress_org_plugin_setup' );