PluginProbe
Bulk Delete / trunk
Bulk Delete vtrunk
6.12 trunk 0.2 0.3 0.4 0.6 0.7 0.8 1.0 1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0 2.1 2.2 2.2.1 2.2.2 3.0 3.1 All 64 releases
bulk-delete / include / Core / Addon / BaseAddon.php

BaseAddon.php in Bulk Delete trunk, at include/Core/Addon/BaseAddon.php

67 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace BulkWP\BulkDelete\Core\Addon;
4
5 use BulkWP\BulkDelete\Core\BulkDelete;
6
7 defined( 'ABSPATH' ) || exit; // Exit if accessed directly.
8
9 /**
10 * Encapsulates the logic for a add-on.
11 *
12 * @since 6.0.0
13 */
14 abstract class BaseAddon {
15 /**
16 * Details of the Add-on.
17 *
18 * @var \BulkWP\BulkDelete\Core\Addon\AddonInfo
19 */
20 protected $addon_info;
21
22 /**
23 * Initialize and setup variables.
24 *
25 * @return void
26 */
27 abstract protected function initialize();
28
29 /**
30 * Register the add-on.
31 *
32 * This method will be called in the `bd_loaded` hook.
33 *
34 * @return void
35 */
36 abstract public function register();
37
38 /**
39 * Create a new instance of the add-on.
40 *
41 * @param \BulkWP\BulkDelete\Core\Addon\AddonInfo $addon_info Add-on Details.
42 */
43 public function __construct( $addon_info ) {
44 $this->addon_info = $addon_info;
45
46 $this->initialize();
47 }
48
49 /**
50 * Get details about the add-on.
51 *
52 * @return \BulkWP\BulkDelete\Core\Addon\AddonInfo Add-on Info.
53 */
54 public function get_info() {
55 return $this->addon_info;
56 }
57
58 /**
59 * Get reference to the main Bulk Delete object.
60 *
61 * @return \BulkWP\BulkDelete\Core\BulkDelete BulkDelete object.
62 */
63 public function get_bd() {
64 return BulkDelete::get_instance();
65 }
66 }
67