-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbatchpress.php
More file actions
executable file
·56 lines (47 loc) · 1.23 KB
/
batchpress.php
File metadata and controls
executable file
·56 lines (47 loc) · 1.23 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
56
<?php
/**
* Plugin Name: BatchPress
* Plugin URI: https://github.com/lambry/batchpress
* Description: A little plugin to help process data in batches.
* Version: 0.4.2
* Author: Lambry
* Author URI: https://lambry.com/
*/
namespace Lambry\BatchPress;
if (!defined('ABSPATH')) exit;
define('BATCHPRESS_VERSION', '0.4.2');
define('BATCHPRESS_ASSETS', plugin_dir_url(__FILE__) . 'assets/');
define('BATCHPRESS_INCLUDES', plugin_dir_path(__FILE__) . 'includes/');
class Init
{
/**
* Add actions.
*/
public function __construct()
{
if (is_admin()) {
$this->includes();
add_action('plugins_loaded', fn () => new Setup());
add_filter('plugin_action_links_' . plugin_basename(__FILE__), [$this, 'links']);
}
}
/**
* Required files.
*/
public function includes() : void
{
require_once BATCHPRESS_INCLUDES . 'helpers.php';
require_once BATCHPRESS_INCLUDES . 'updater.php';
require_once BATCHPRESS_INCLUDES . 'setup.php';
}
/**
* Add action links to plugins page
*/
public function links(array $links): array
{
return array_merge([
'<a href="' . admin_url('tools.php?page=batchpress') . '">' . __('Dashboard', 'batchpress') . '</a>',
], $links);
}
}
new Init();