-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathplugin.php
More file actions
38 lines (31 loc) · 1.21 KB
/
plugin.php
File metadata and controls
38 lines (31 loc) · 1.21 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
<?php
/**
* Plugin Name: WordPress Queue
* Plugin URI: https://github.com/devgeniem/wp-import-controller
* Description: WordPress Queue is a modular library for managing queued tasks in WordPress.
* Version: 1.0.2
* Requires at least: 5.4
* Requires PHP: 8.0
* Author: Geniem
* Author URI: https://geniem.com/
* License: MIT
* License URI: https://www.gnu.org/licenses/gpl-3.0.html
*/
namespace Geniem\Queue;
// Check if Composer has been initialized in this directory.
// Otherwise, we just use global composer autoloading.
if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
require_once __DIR__ . '/vendor/autoload.php';
}
// Require global functions.
require_once __DIR__ . '/src/functions.php';
// Define the plugin initialization hook through a filter.
$init_hook = apply_filters( 'wqp_init_hook', 'plugins_loaded' );
// Initialize the plugin.
add_action( $init_hook, function() {
// Get the plugin version.
$plugin_data = \get_file_data( __FILE__, [ 'Version' => 'Version' ], 'plugin' );
$plugin_version = $plugin_data['Version'];
$plugin_path = __DIR__;
QueuePlugin::init( $plugin_version, $plugin_path );
} );